Skip to content

Instantly share code, notes, and snippets.

@s-fernandez-v
Last active March 27, 2023 11:31
Show Gist options
  • Save s-fernandez-v/9733a88d4265d8c9e7408ec303fe9b9b to your computer and use it in GitHub Desktop.
Save s-fernandez-v/9733a88d4265d8c9e7408ec303fe9b9b to your computer and use it in GitHub Desktop.
BorderBrush action
<Grid
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:b="http://schemas.microsoft.com/xaml/behaviors">
<Border x:Name="TheBorder" Width="200" Height="100" BorderBrush="Red" Background="Pink">
<b:Interaction.Triggers>
<b:EventTrigger EventName="Loaded">
<b:ChangePropertyAction TargetName="TheBorder" PropertyName="BorderThickness" Value="1"/>
</b:EventTrigger>
<b:EventTrigger EventName="MouseDown">
<b:ChangePropertyAction TargetName="TheBorder" PropertyName="BorderThickness" Value="20"/>
<b:ChangePropertyAction TargetName="TheBorder" PropertyName="BorderBrush" Value="Green"/>
</b:EventTrigger>
<b:EventTrigger EventName="MouseUp">
<b:ChangePropertyAction TargetName="TheBorder" PropertyName="BorderThickness" Value="10"/>
<b:ChangePropertyAction TargetName="TheBorder" PropertyName="BorderBrush" Value="Blue"/>
</b:EventTrigger>
</b:Interaction.Triggers>
</Border>
</Grid>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment