Created
February 17, 2014 19:05
-
-
Save GSonofNun/9056882 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void Grid_Hold(object sender, System.Windows.Input.GestureEventArgs e) | |
{ | |
Grid g = (Grid)sender; | |
// This throws an error because you can't pass a Grid as a Control in the first parameter | |
VisualStateManager.GoToState(g, "Context", true); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<DataTemplate x:Key="ItemTemplate1"> | |
<Grid Hold="Grid_Hold" > | |
<VisualStateManager.VisualStateGroups> | |
<VisualStateGroup x:Name="CommonStates"> | |
<VisualState x:Name="Normal"> | |
<Storyboard> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ContextGrid"> | |
<DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed"/> | |
</ObjectAnimationUsingKeyFrames> | |
</Storyboard> | |
</VisualState> | |
<VisualState x:Name="Context"> | |
<Storyboard> | |
<ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Visibility" Storyboard.TargetName="ContextGrid"> | |
<DiscreteObjectKeyFrame KeyTime="0" Value="Visible"/> | |
</ObjectAnimationUsingKeyFrames> | |
</Storyboard> | |
</VisualState> | |
</VisualStateGroup> | |
</VisualStateManager.VisualStateGroups> | |
<!-- Main Content --> | |
<Grid x:Name="ContextGrid" Background="#99000000" Visibility="Collapsed"> | |
<!-- Context Content --> | |
</Grid> | |
</Grid> | |
</DataTemplate> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment