Skip to content

Instantly share code, notes, and snippets.

@s-fernandez-v
Last active July 8, 2024 16:25
Show Gist options
  • Save s-fernandez-v/93cdae35b653f82f899761e9af1dc4f3 to your computer and use it in GitHub Desktop.
Save s-fernandez-v/93cdae35b653f82f899761e9af1dc4f3 to your computer and use it in GitHub Desktop.
Text reveal
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid.Resources>
<Storyboard x:Key="anim">
<!--Gradually unclip fs_text -->
<RectAnimation Storyboard.TargetName="FsTextClip"
Storyboard.TargetProperty="Clip.Rect"
From="0,0,0,204.58"
To="0,0,613.66,204.58"
Duration="0:0:0.6"
BeginTime="0:0:1"/>
</Storyboard>
</Grid.Resources>
<Grid.Triggers>
<EventTrigger RoutedEvent="Grid.Loaded">
<BeginStoryboard Storyboard="{StaticResource anim}"/>
</EventTrigger>
</Grid.Triggers>
<Canvas x:Name="FsTextClip" Width="600" Height="200" Background="Silver">
<Canvas.Clip>
<RectangleGeometry Rect="0,0,0,204.58"/>
</Canvas.Clip>
<TextBlock Text="This is a text inside a canvas that will reveal with an animation."/>
</Canvas>
</Grid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment