Skip to main content
Home Forums Silverlight Programming Programming with .NET - General VisualStateGroup name always return null?
2 replies. Latest Post by cncolder on October 12, 2008.
(0)
cncolder
Member
45 points
29 Posts
10-10-2008 9:27 PM |
Here is my xaml file:
<!-- Xaml --> <vsm:VisualStateManager.VisualStateGroups> <vsm:VisualStateGroup x:Name="VisualStateGroup1"> ... </vsm:VisualStateGroup> </vsm:VisualStateManager.VisualStateGroups>
When I use the xname in code file like this:
VisualStateGroup1.CurrentStateChanging += new EventHandler...
pbrooks
Contributor
2671 points
355 Posts
10-11-2008 6:17 PM |
cncolder,
You could do something like this:
var vsGroup = VisualStateManager.GetVisualStateGroups(LayoutRoot)[0] as VisualStateGroup;vsGroup.CurrentStateChanging += new EventHandler<VisualStateChangedEventArgs>(vsGroup_CurrentStateChanging);...private void vsGroup_CurrentStateChanging(object sender, VisualStateChangedEventArgs e){ System.Diagnostics.Debug.WriteLine(e.NewState.Name);}
10-12-2008 8:57 PM |
Yes. I have done like your code. I wanna find why it's null only. But still would like to thanks