Notaus, Emergency button, WPF Xaml

This is a default emergency button used to signal alarm states (blinking at given rate) made in WPF XAML an ready to use
<Style x:Key="notAusButton" TargetType="{x:Type CheckBox}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="CheckBox"> <BulletDecorator Background="Transparent" Cursor="Hand"> <BulletDecorator.Bullet> <Grid Width="Auto" Height="Auto" Margin="0,4" HorizontalAlignment="Center" VerticalAlignment="Center"> <Border BorderBrush="Gray" BorderThickness="1" CornerRadius="50"> <Border x:Name="outerBorder" Width="50" Height="50" Background="{StaticResource lightBackColor}" CornerRadius="50"> <Border x:Name="innerBorder" Width="30" Height="30" Background="#FF979797" BorderBrush="Black" BorderThickness="0,0,3,3" CornerRadius="30"> <Border Width="15" Height="15" BorderBrush="Gray" BorderThickness="1" CornerRadius="25" /> </Border> </Border> </Border> <!-- OUTER --> </Grid> </BulletDecorator.Bullet> </BulletDecorator> <ControlTemplate.Triggers> <Trigger Property="IsChecked" Value="true"> <Trigger.EnterActions> <BeginStoryboard Name="BlinkStory"> <Storyboard> <DoubleAnimation AutoReverse="True" RepeatBehavior="Forever" Storyboard.TargetName="outerBorder" Storyboard.TargetProperty="Opacity" From="0.3" To="1" Duration="0:0:1" /> </Storyboard> </BeginStoryboard> <BeginStoryboard Name="BlinkStory2"> <Storyboard> <ColorAnimation AutoReverse="True" FillBehavior="Stop" RepeatBehavior="Forever" Storyboard.TargetName="innerBorder" Storyboard.TargetProperty="(Button.Background).(SolidColorBrush.Color)" To="Orange" Duration="0:0:0.5" /> </Storyboard> </BeginStoryboard> </Trigger.EnterActions> <Trigger.ExitActions> <RemoveStoryboard BeginStoryboardName="BlinkStory" /> <RemoveStoryboard BeginStoryboardName="BlinkStory2" /> </Trigger.ExitActions> <Setter TargetName="outerBorder" Property="Background" Value="Yellow" /> <Setter TargetName="innerBorder" Property="Background" Value="Red" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style>
Post a Comment
0 Comments
Thanks!