Advertisement
Guest User

Untitled

a guest
Feb 1st, 2012
142
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.30 KB | None | 0 0
  1. <Grid x:Name="CheatGrid">
  2.   <Grid.Resources>
  3.     <Storyboard x:Name="TransitionCheatOut">
  4.       <DoubleAnimation From="0" To="-200" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="CheatGrid" />
  5.       <DoubleAnimation To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="CheatGrid" />
  6.     </Storyboard>
  7.     <Storyboard x:Name="TransitionCheatIn">
  8.       <DoubleAnimation From="200" To="0" Storyboard.TargetProperty="(UIElement.RenderTransform).(TranslateTransform.X)" Storyboard.TargetName="CheatGrid" />
  9.       <DoubleAnimation To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="CheatGrid" />
  10.     </Storyboard>
  11.   </Grid.Resources>
  12.   <Grid.RenderTransform>
  13.     <TranslateTransform />
  14.   </Grid.RenderTransform>
  15.   <!-- Insert your current cheat text stuff here --!>
  16. </Grid>
  17.  
  18.  
  19. // Call to begin transitioning to a new cheat
  20. private void ShowCheat(int cheatId) {
  21.     Action onTransitionOutComplete = null;
  22.     onTransitionOutComplete = delegate {
  23.         TransitionCheatOut.Complete -= onTransitionOutComplete;
  24.         // Update the text blocks to contain the new cheat text
  25.         TransitionCheatIn.Begin();
  26.     };
  27.     TransitionCheatOut.Complete += onTransitionComplete;
  28.     TransitionCheatOut.Begin();
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement