daily pastebin goal
5%
SHARE
TWEET

Untitled

a guest Aug 10th, 2018 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Update page layout before Thread.Sleep()
  2. <Grid
  3.   x:Name="ContentPanel"
  4.   Grid.Row="1"
  5.   Margin="12,0,12,0">
  6.   <TextBlock
  7.     Margin='79,263,177,307'
  8.     Name='textBlock1'
  9.     Text='TextBlock'
  10.     RenderTransformOrigin="0.5,0.5">
  11.     <TextBlock.RenderTransform>
  12.         <CompositeTransform />
  13.     </TextBlock.RenderTransform>
  14.   </TextBlock>
  15.   <Button
  16.     Content="Button"
  17.     Height="80"
  18.     Margin="116,0,188,144"
  19.     VerticalAlignment="Bottom"
  20.     Click='Button_Click' />
  21. </Grid>
  22.    
  23. <phone:PhoneApplicationPage.Resources>
  24. <Storyboard
  25.   x:Name="MoveTextBlockStoryboard">
  26.   <DoubleAnimationUsingKeyFrames
  27.     Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateX)"
  28.     Storyboard.TargetName="textBlock1">
  29.     <EasingDoubleKeyFrame
  30.       KeyTime="0"
  31.       Value="0" />
  32.     <EasingDoubleKeyFrame
  33.       KeyTime="0:0:1.1"
  34.       Value="120" />
  35.   </DoubleAnimationUsingKeyFrames>
  36.   <DoubleAnimationUsingKeyFrames
  37.     Storyboard.TargetProperty="(UIElement.RenderTransform).(CompositeTransform.TranslateY)"
  38.     Storyboard.TargetName="textBlock1">
  39.     <EasingDoubleKeyFrame
  40.       KeyTime="0"
  41.       Value="0" />
  42.     <EasingDoubleKeyFrame
  43.       KeyTime="0:0:1.1"
  44.       Value="-105" />
  45.   </DoubleAnimationUsingKeyFrames>
  46. </Storyboard>
  47.    
  48. private void Button_Click(object sender, RoutedEventArgs e) {
  49.   textBlock1.Text = "new text";
  50.   MoveTextBlockStoryboard.Begin();
  51.  
  52. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top