Automatic or easy to configure support for displaying the UAC shield icon when the command that will be executed by the Button or the Menu item will require elevated permissions.
Posted on:02 Sep 2016 08:50
Glad to hear you find this useful.
I am not sure, however, if such a API for automatically setting the image is necessary. Following the same logic we may have to introduce such for Error, Exclamation, Question and plenty other icons which will make the API cumbersome.
Setting UAC image takes just 2 lines of code with the approach provided, which seems pretty acceptable and no need for third party implementation. This is why, we will be declining this request as well.
Posted on:01 Sep 2016 16:38
Thanks for your code block.. it really simplify how to get the UAC shield image and set it to a button! :-)
I was wondering if is possible to create a bool property in the RadButton so when it is true, the button checks the Windows UAC level and set the icon by itself. Of course, when false the button has the same behavior as today. Thus, I don't need to have any code block to change the icon! :-D
Posted on:01 Sep 2016 15:32
Looking further into this, I found a really easy way to set the UAC icon to your buttons, which makes wrapping such function unnecessary:
System.Drawing.Icon myIcon = new System.Drawing.Icon(System.Drawing.SystemIcons.Shield, 16, 16);
radButton1.Image = myIcon.ToBitmap();
Posted on:01 Sep 2016 15:13
The button/menu item does not know what you will execute in its click handler, so it cannot detect automatically. Perhaps, what we can do is to wrap the function you currently use in some kind of method and expose it for you to use - the function will return again the image which should be assigned to the button Image property. I don't really see much benefit in this.
Let me know what are your thoughts, or if you had something different in mind.
Posted on:01 Sep 2016 14:17
I know about setting images to buttons, but what I mean is that the button component should do it automatically according to UAC config level.
Check the workaround we have to do in WinForms: http://www.telerik.com/forums/button-and-uac-shield.
Posted on:01 Sep 2016 12:30
for WinForms related requests please use the WinForms portal: http://feedback.telerik.com/Project/154
As to the UAC icon, you can set images to buttons and menu items in WinForms, so feel free to set it for the items you need. If this is not what you need, let us know in the portal or in a support thread, so we can discuss this matter further.
Posted on:01 Sep 2016 12:00
Please.. This suggestion must be implemented in the Windows Forms too, not only WPF and Silverlight!