When I started to follow some of the video tuturial for Expression Blend 3, I noticed that States pane is not available when I work on the WPF project; however, it is there when I create a Silverlight project. Apparetly the state manager is part of WPFToolkit and the work arround this issue is explained in team blog of the Expression Blend:
Here are the steps you need to follow to get to the VSM-for-WPF goodness:
- Install the WPF Toolkit from http://www.codeplex.com/wpf/Release/ProjectReleases.aspx?ReleaseId=15598
- Create the following registry value and make it non-zero. The value should be of type DWORD. Or run the appropriate .REG file attached to this post (or by clicking here).
- 32 bit OS : HKLM/Software/Microsoft/Expression/Blend/EnableVSM
- 64 bit OS : HKLM/Software/Wow6432Node/Microsoft/Expression/Blend/EnableVSM
- If Blend was running during the previous step then restart it.
- Create a new WPF project.
- Add %Program Files%\WPF\WPF Toolkit\…\WPFToolkit.dll to the References folder (Right-click the References node in Project, then click Add Reference…).
- Close and reopen Window1.xaml. The States pane will now appear for the project.
I found the following articles very good well explained walkthrough for creating a custom button in WPF or Silverlight:
To assign a style to a control in WPF (or Silverlight) you can use Dynamic or Static markup extension. According to MDSN Article the differences are:
The StaticResource Markup Extension processes a key by looking up the value for that key in all available resource dictionaries. This happens during loading, which is the point in time when the loading process needs to assign the property value that takes the static resource reference. The DynamicResource Markup Extension instead processes a key by creating an expression, and that expression remains unevaluated until the application is actually run, at which time the expression is evaluated and provides a value.