add FlipClock

This commit is contained in:
NaBian committed 2018-12-22 16:19:26 +08:00
1 parent 2a87323e0f
commit 7e98de25a3
22 files changed
+175 -78

No files matched your search

+34
View File
@@ -0,0 +1,34 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:HandyControl.Controls">
<Style TargetType="controls:FlipNumber">
<Setter Property="FontSize" Value="70"/>
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}"/>
<Setter Property="Background" Value="{DynamicResource TitleBrush}"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="180"/>
<Setter Property="Camera">
<Setter.Value>
<PerspectiveCamera Position="0 0 120" LookDirection="0 0 -1" />
</Setter.Value>
</Setter>
</Style>
<Style TargetType="controls:FlipClock">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:FlipClock">
<StackPanel Orientation="Horizontal">
<controls:FlipNumber Margin="-20" Number="{Binding NumberList[0],RelativeSource={RelativeSource TemplatedParent}}"/>
<controls:FlipNumber Margin="-20" Number="{Binding NumberList[1],RelativeSource={RelativeSource TemplatedParent}}"/>
<controls:FlipNumber Margin="0,-20,-20,-20" Number="{Binding NumberList[2],RelativeSource={RelativeSource TemplatedParent}}"/>
<controls:FlipNumber Margin="-20" Number="{Binding NumberList[3],RelativeSource={RelativeSource TemplatedParent}}"/>
<controls:FlipNumber Margin="0,-20,-20,-20" Number="{Binding NumberList[4],RelativeSource={RelativeSource TemplatedParent}}"/>
<controls:FlipNumber Margin="-20" Number="{Binding NumberList[5],RelativeSource={RelativeSource TemplatedParent}}"/>
</StackPanel>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
@@ -1,17 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:HandyControl.Controls">
<Style TargetType="controls:FlipNumber">
<Setter Property="FontSize" Value="70"/>
<Setter Property="Foreground" Value="#ccc"/>
<Setter Property="Background" Value="#333"/>
<Setter Property="Width" Value="120"/>
<Setter Property="Height" Value="180"/>
<Setter Property="Camera">
<Setter.Value>
<PerspectiveCamera Position="0 0 120" LookDirection="0 0 -1" />
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>
+1 -1
View File
@@ -47,7 +47,7 @@
<ResourceDictionary Source="SearchBar.xaml"/>
<ResourceDictionary Source="Tag.xaml"/>
<ResourceDictionary Source="RadioGroup.xaml"/>
<ResourceDictionary Source="FlipNumber.xaml"/>
<ResourceDictionary Source="FlipClock.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
+12 -10
View File
@@ -24,10 +24,12 @@
<Setter Property="UseLayoutRounding" Value="True"/>
<Setter Property="NonClientAreaBackground" Value="{DynamicResource TitleBrush}"/>
<Setter Property="NonClientAreaForeground" Value="White"/>
<Setter Property="CloseButtonHoverBrush" Value="Red"/>
<Setter Property="CloseButtonHoverBackground" Value="Red"/>
<Setter Property="CloseButtonHoverForeground" Value="White"/>
<Setter Property="OtherButtonHoverBrush" Value="{DynamicResource DarkPrimaryBrush}"/>
<Setter Property="CloseButtonBackground" Value="Transparent"/>
<Setter Property="OtherButtonHoverBackground" Value="{DynamicResource DarkPrimaryBrush}"/>
<Setter Property="OtherButtonHoverForeground" Value="White"/>
<Setter Property="OtherButtonBackground" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:WindowBorderless">
@@ -43,10 +45,10 @@
<ColumnDefinition Width="Auto"/>
</Grid.ColumnDefinitions>
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
<Button Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" Padding="17,0"/>
<Button Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" Padding="17,0"/>
<Button Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" Padding="17,0"/>
<Button Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource CloseGeometry}" Padding="9"/>
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" Padding="17,0"/>
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" Padding="17,0"/>
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" Padding="17,0"/>
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="28" Style="{StaticResource ButtonIcon}" Width="44" controls:IconElement.Geometry="{StaticResource CloseGeometry}" Padding="9"/>
</StackPanel>
<Grid Grid.Column="0">
<Grid.ColumnDefinitions>
@@ -86,19 +88,19 @@
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBrush,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Background" TargetName="ButtonClose" Value="{Binding CloseButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMax">
<Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBrush,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Background" TargetName="ButtonMax" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonRestore">
<Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBrush,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Background" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMin">
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBrush,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Background" TargetName="ButtonMin" Value="{Binding OtherButtonHoverBackground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
</Trigger>
<Trigger Property="ShowNonClientArea" Value="False">