silverlight - How can I use VisualStates in a ChildWindow? -


Is there any way to use VisualStateManager with my childwindow subclass? There is nothing to call VisualStateManager, and the googling I did was the only way to achieve this with the manual call to the storyboard. It is so annoying and error that someone has found a way to get it ?

Updated with example code . To use it, just create a new Silverlight project, and for example Windows ShowWindow () Click on the main page from a button. You will see a button, even if the constructor sets the state that the button is hidden.

XAML (e.g. Window.xaml):

  & lt; Control: ChildWindow xmlns = "Http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml" xmlns: controls = " Clr-namespace: System.Windows.Controls; assembly = System.Windows.Controls "xmlns: D =" http://schemas.microsoft.com/expression/blend/2008 "xmlns: mc =" http: // schemas. Openxmlformats.org/markup -compatibility / 2006 "MC: Ignorable =" d "xmlns: ic =" clr-namespace: Microsoft.Expression.Interactivity.Core; assembly = Microsoft.Expression.Interactions "x: Class =" Client.Windows .ExampleWindow "title =" example "& gt; & Lt; Grid X: Name = "Layouts" & gt; & Lt; VisualStateManager.VisualStateGroups & gt; & Lt; VisualState Group x: name = "ExampleState Group" & gt; & Lt; VisualState X: Name = "Example Busestate" & gt; & Lt; Storyboard & gt; & Lt; Double AnimationUseFormems Start Time = "00:00:00" Duration = "00: 00: 00.0010000" Storyboard Target name = "button" storyboard Targetproperty = "(UIElement.Opacity)" & gt; & Lt; EasingDoubleKeyFrame KeyTime = "00:00:00" value = "0" /> & Lt; / DoubleAnimationUsingKeyFrames & gt; & Lt; / Storyboard & gt; & Lt; / VisualState & gt; & Lt; / VisualStateGroup & gt; & Lt; /VisualStateManager.VisualStateGroups> & Lt; VisualStateManager.CustomVisualStateManager & gt; & Lt; IC: ExtendedVisualStateManager / & gt; & Lt; /VisualStateManager.CustomVisualStateManager> & Lt; Button x: name = "button" content = "you should not see me" grid Colspan = "2" width = "150" height = "150" horizontal alignment = "center" vertical element = "center" /> & Lt; / Grid & gt; & Lt; / Control: ChildWindow & gt;  

Code Behind (Example Window.xaml.cs):

  Using System.Windows; Using System.Windows.Controls; Namespace Client Windows {Public Partial Class Example Window: ChildWindow {Public Example Window () {InitializeComponent (); VisualStateManager.GoToState (this, "ExampleBaseState", true); } Public static void ShowWindow () {var w = New Example Window (); W.Show (); }}}  

Check this post

< / Html>

Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -