Reputation: 11
I'm creating a custom dashboard widget for TFS.
Can I use the build-in controls like the Query Selector or the Color Selector on my widget's configuration view?
Thanks, Oron
Upvotes: 1
Views: 586
Reputation: 51103
Yes, you could. A sample configuration as below:
How to and detail code please refer this tutorial from MSDN: Part 3: Hello World with Configuration
Update:
If you want the feature just like create a query in the widget, this is not support for now. You may have to get the queries first and then add them in the widget.
About color selector, you could only change the background color and front color of the widge. A sample:
data:text/html,<html><body style="background-color:#69f;color:#fff;font:26px Segoe UI,Frutiger,Frutiger Linotype,Dejavu Sans,Helvetica Neue,Arial,sans-serif"><div id="time" style="text-align:center;margin-top:36px"></div></body><script>setInterval(function(){document.getElementById('time').innerHTML = (new Date()).toISOString().replace(/T/g, '<br />').replace(/\..*/g, '')}, 100)</script></html>
You could find more customized widget in VisualStudio Marketplace.
Upvotes: 1
Reputation: 29976
There isn't any way to achieve this feature as I know. For Query Selector, you need to call VSTS Rest API to get the queries and add them to the dropdown list manually, and for Color Selector, you could check the code sample in this extension for reference: Countdown-Widget-Extension.
Upvotes: 1