![]() ![]() ![]() Checking MIME type for cross domain Silverlight ho.Book Review – The Art of Unit Testing (Roy Osherove).I’ll maybe look into converting them to VisualStates for a future blog post. Sadly, the use of ControlTemplate triggers means that this template can’t be used directly in Silverlight. Here’s how we declare a few of these buttons of different sizes, and with different background colours: I haven’t created any triggers yet for IsMouseOver, IsEnabled or IsFocused, mainly because I’m not quite sure what would create a the right visual effect. For the IsPressed effect, I simply change the angle of the linear gradient of the inner circle a little, and move the ContentPresenter down a bit, which seems to work OK. The focus rectangle has been made circular. I couldn’t come up with a neat way of forcing the button to be circular, but it is not too much of a chore to set the Height and Width in XAML. We allow the Background colour to be overriden by the user if required. Now to turn it into a template, we follow a very similar process to before. ![]() The basic background of the button is formed by superimposing three circles on top of each other: This one is in response to a question about how the button could be made circular. Here’s another WPF button template, since my first one continues to be one of the most popular posts on my blog. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |