123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990 |
- <UserControl x:Class="CyberX8_Themes.UserControls.Blower"
- 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:CyberX8_Themes.UserControls"
- xmlns:converters="clr-namespace:CyberX8_Themes.Converters"
- mc:Ignorable="d"
- x:Name="blower"
- d:DesignHeight="80" d:DesignWidth="80">
- <UserControl.Resources>
- <converters:BoolToVisibility x:Key="boolToVisibility"></converters:BoolToVisibility>
- <converters:BoolToVisibility2 x:Key="boolToVisibility2"></converters:BoolToVisibility2>
- <Style x:Key="StackPanelStyle" TargetType="StackPanel">
- <Style.Setters>
- <Setter Property="RenderTransform">
- <Setter.Value>
- <TransformGroup>
- <RotateTransform/>
- </TransformGroup>
- </Setter.Value>
- </Setter>
- </Style.Setters>
- <Style.Triggers>
- <DataTrigger Binding="{Binding ElementName=blower, Path=IsPowerOn}" Value="True">
- <DataTrigger.EnterActions>
- <BeginStoryboard x:Name="StackPanelStoryBoard">
- <Storyboard RepeatBehavior="Forever">
- <DoubleAnimation Storyboard.TargetProperty=
- "RenderTransform.Children[0].Angle"
- Duration="0:0:1" BeginTime="0:0:0"
- From="0" To="-360" />
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.EnterActions>
- <DataTrigger.ExitActions>
- <StopStoryboard BeginStoryboardName="StackPanelStoryBoard" />
- </DataTrigger.ExitActions>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- <Style x:Key="StackPanelStyle1" TargetType="StackPanel">
- <Style.Setters>
- <Setter Property="RenderTransform">
- <Setter.Value>
- <TransformGroup>
- <RotateTransform/>
- </TransformGroup>
- </Setter.Value>
- </Setter>
- </Style.Setters>
- <Style.Triggers>
- <DataTrigger Binding="{Binding ElementName=blower, Path=IsHighOn}" Value="True">
- <DataTrigger.EnterActions>
- <BeginStoryboard x:Name="StackPanelStoryBoard">
- <Storyboard RepeatBehavior="Forever">
- <DoubleAnimation Storyboard.TargetProperty=
- "RenderTransform.Children[0].Angle"
- Duration="0:0:0.5" BeginTime="0:0:0"
- From="0" To="-360" />
- </Storyboard>
- </BeginStoryboard>
- </DataTrigger.EnterActions>
- <DataTrigger.ExitActions>
- <StopStoryboard BeginStoryboardName="StackPanelStoryBoard" />
- </DataTrigger.ExitActions>
- </DataTrigger>
- </Style.Triggers>
- </Style>
- </UserControl.Resources>
- <Viewbox Stretch="Fill" Margin="0,0,0,4">
- <Canvas Width="70" Height="70" RenderTransformOrigin="0.49 0.49">
- <Canvas.RenderTransform>
- <TransformGroup>
- <RotateTransform Angle="{Binding ElementName=pump1,Path=RotateTransformValue}"></RotateTransform>
- </TransformGroup>
- </Canvas.RenderTransform>
- <StackPanel>
- <Image Width="70" Height="70" Source="pack://application:,,,/CyberX8_Themes;component/Themes/Images/parts/blower.png"></Image>
- </StackPanel>
- <StackPanel Style="{StaticResource StackPanelStyle}" RenderTransformOrigin="0.49,0.49" Margin="13,20,0,0" Visibility="{Binding ElementName=blower,Path=IsHighOn,Converter={StaticResource boolToVisibility}}">
- <Image Width="30" Height="30" Source="pack://application:,,,/CyberX8_Themes;component/Themes/Images/parts/Pump2.png"/>
- </StackPanel>
- <StackPanel Style="{StaticResource StackPanelStyle1}" RenderTransformOrigin="0.49,0.49" Margin="13,20,0,0" Visibility="{Binding ElementName=blower,Path=IsHighOn,Converter={StaticResource boolToVisibility2}}">
- <Image Width="30" Height="30" Source="pack://application:,,,/CyberX8_Themes;component/Themes/Images/parts/Pump2.png"/>
- </StackPanel>
- </Canvas>
- </Viewbox>
- </UserControl>
|