Skip to content

Instantly share code, notes, and snippets.

@foglio1024
Created February 22, 2024 11:17
Show Gist options
  • Save foglio1024/da38be33a7e9e163b0ff8b58138512cd to your computer and use it in GitHub Desktop.
Save foglio1024/da38be33a7e9e163b0ff8b58138512cd to your computer and use it in GitHub Desktop.
Animate a Border size based on on the target control size
<Panel>
<Border x:Name="AnimatedBorder">
<Control x:Name="AnimatedBorderGovernor"
Fill="Transparent"
Width="{Binding #Target.Bounds.Width}"
Height="{Binding #Target.Bounds.Height}"
>
<Control.Transitions>
<Transitions>
<DoubleTransition Property="Height" Duration="..." Easing="..."/>
<DoubleTransition Property="Width" Duration="..." Easing="..."/>
</Transitions>
</Control.Transitions>
</Control>
</Border>
<TransitioningContentControl x:Name="Target"/>
</Panel>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment