Live Example:
http://www.adefwebserver.com/Richard/SeekerPartsAndStates/SeekerPartsAndStatesTestPage.html
I’d like to acknowledge that posts by Karen Corby made it possible for me to get to this point in understanding Parts and States.
http://scorbs.com/2008/06/11/parts-states-model-with-visualstatemanager-part-1-of/
In this blog I’m going to show you how to create a multi-part templated control with visual states, then how you can manipulate those parts and states in Blend.
If you’ve been following along, you know that the Seeker inherits from a base class named ooNaThing, who provides basic ooNaThing functionality, so ordinarily it would be ooNaThing that would inherit from Control, but for this demo I’m just going to create a custom control named BigSeeker that inherits from Control directly.
The best way to do this for our purposes is through Visual Studio. There may be an equivalent in Blend, but I don’t know what it is. We’re going to create a Silverlight Templated Control. This not only creates our BigSeeker class, but also creates a file named Generic.xaml, which contains the default ControlTemplate implementation for our new class. And as you will see, it adds code to the BigSeeker class constructor to hook up the C# code to the xaml code in Generic.xaml.
Live Example:
http://www.adefwebserver.com/Richard/SeekerPartsAndStates/SeekerPartsAndStatesTestPage.html
I’d like to acknowledge that posts by Karen Corby made it possible for me to get to this point in understanding Parts and States.
http://scorbs.com/2008/06/11/parts-states-model-with-visualstatemanager-part-1-of/
In this blog I’m going to show you how to create a multi-part templated control with visual states, then how you can manipulate those parts and states in Blend.
If you’ve been following along, you know that the Seeker inherits from a base class named ooNaThing, who provides basic ooNaThing functionality, so ordinarily it would be ooNaThing that would inherit from Control, but for this demo I’m just going to create a custom control named BigSeeker that inherits from Control directly.
The best way to do this for our purposes is through Visual Studio. There may be an equivalent in Blend, but I don’t know what it is. We’re going to create a Silverlight Templated Control. This not only creates our BigSeeker class, but also creates a file named Generic.xaml, which contains the default ControlTemplate implementation for our new class. And as you will see, it adds code to the BigSeeker class constructor to hook up the C# code to the xaml code in Generic.xaml.
from Richard Waddell more here