Files
desktop-edge-win/DesktopEdge/Views/Controls/Toggler.xaml
T
2021-03-11 12:42:27 -05:00

34 lines
1.9 KiB
XML

<UserControl x:Class="ZitiDesktopEdge.Toggler"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ZitiDesktopEdge"
mc:Ignorable="d"
d:DesignHeight="20"
d:DesignWidth="35"
Width="35"
Height="20"
Padding="0,0,0,0"
Loaded="OnLoad">
<StackPanel Orientation="Vertical" Margin="0,0,0,0">
<Canvas Name="LayoutRoot" Cursor="Hand" MouseUp="OnToggle">
<Canvas.Resources>
<Storyboard Name="AnimateOnBoard" x:Key="OnAnimate">
<DoubleAnimation Name="OpaqueOnAnimate" Storyboard.TargetName="OnColor" Storyboard.TargetProperty="Opacity" Duration="1" To="1"></DoubleAnimation>
</Storyboard>
<Storyboard Name="AnimateOffBoard" x:Key="OffAnimate">
<DoubleAnimation Name="OpaqueOffAnimate" Storyboard.TargetName="OnColor" Storyboard.TargetProperty="Opacity" Duration="1" To="1"></DoubleAnimation>
</Storyboard>
</Canvas.Resources>
<Border Name="BackColor" Width="35" Height="20" CornerRadius="9" Background="#E5EAED"></Border>
<Border Name="OnColor" Width="35" Height="20" CornerRadius="9" Background="#34A22B" Opacity="0"></Border>
<Border Name="ToggleTab" Width="18" Height="18" Canvas.Top="1" Canvas.Left="1" CornerRadius="9,9,9,9" Background="White">
<Border.Effect>
<DropShadowEffect Direction="270" Opacity=".2" />
</Border.Effect>
</Border>
</Canvas>
</StackPanel>
</UserControl>