Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

21. Templates > Visual States

Visual States

In the last chapter we used property and event triggers to define the visual behavior of a control. Inside a control template (and unfortunately only inside a control template) you have another, more powerful option: the VisualStateManager. Like control parts, the visual states that are supported by a control are defined by its control contract, using the TemplateVisualState attribute, which defines both the state and the state group:

[TemplateVisualState(Name="Normal", StateGroup="CommonStates")]

image

Put on Your Thinking Hat

image

The Button element has three state groups and a total of nine visual states, as shown below. Write a skeleton of a control template that defines each state. (You know how to do that, right?) Don’t worry about the Storyboard right now.


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint