add FlipClock
This commit is contained in:
1 parent
2a87323e0f
commit
7e98de25a3
22 files changed
+175
-78
No files matched your search
@@ -0,0 +1,57 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Threading;
|
||||||
|
|
||||||
|
namespace HandyControl.Controls
|
||||||
|
{
|
||||||
|
public class FlipClock : Control
|
||||||
|
{
|
||||||
|
public static readonly DependencyProperty NumberListProperty = DependencyProperty.Register(
|
||||||
|
"NumberList", typeof(List<int>), typeof(FlipClock), new PropertyMetadata(new List<int> {0, 0, 0, 0, 0, 0}));
|
||||||
|
|
||||||
|
public List<int> NumberList
|
||||||
|
{
|
||||||
|
get => (List<int>) GetValue(NumberListProperty);
|
||||||
|
set => SetValue(NumberListProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty DisplayTimeProperty = DependencyProperty.Register(
|
||||||
|
"DisplayTime", typeof(DateTime), typeof(FlipClock), new PropertyMetadata(default(DateTime), OnDisplayTimeChanged));
|
||||||
|
|
||||||
|
private static void OnDisplayTimeChanged(DependencyObject s, DependencyPropertyChangedEventArgs e)
|
||||||
|
{
|
||||||
|
var ctl = (FlipClock) s;
|
||||||
|
var v = (DateTime) e.NewValue;
|
||||||
|
|
||||||
|
ctl.NumberList = new List<int>
|
||||||
|
{
|
||||||
|
v.Hour / 10,
|
||||||
|
v.Hour % 10,
|
||||||
|
v.Minute / 10,
|
||||||
|
v.Minute % 10,
|
||||||
|
v.Second / 10,
|
||||||
|
v.Second % 10
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
public DateTime DisplayTime
|
||||||
|
{
|
||||||
|
get => (DateTime) GetValue(DisplayTimeProperty);
|
||||||
|
set => SetValue(DisplayTimeProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public FlipClock()
|
||||||
|
{
|
||||||
|
var dispatcherTimer = new DispatcherTimer
|
||||||
|
{
|
||||||
|
Interval = TimeSpan.FromMilliseconds(200)
|
||||||
|
};
|
||||||
|
dispatcherTimer.Tick += DispatcherTimer_Tick;
|
||||||
|
dispatcherTimer.Start();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void DispatcherTimer_Tick(object sender, EventArgs e) => DisplayTime = DateTime.Now;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,4 +1,5 @@
|
|||||||
using System;
|
using System;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
@@ -64,6 +65,7 @@ namespace HandyControl.Controls
|
|||||||
public static readonly DependencyProperty FontSizeProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty FontSizeProperty = DependencyProperty.Register(
|
||||||
"FontSize", typeof(double), typeof(FlipNumber), new PropertyMetadata(70.0));
|
"FontSize", typeof(double), typeof(FlipNumber), new PropertyMetadata(70.0));
|
||||||
|
|
||||||
|
[TypeConverter(typeof(FontSizeConverter))]
|
||||||
public double FontSize
|
public double FontSize
|
||||||
{
|
{
|
||||||
get => (double)GetValue(FontSizeProperty);
|
get => (double)GetValue(FontSizeProperty);
|
||||||
@@ -96,7 +98,7 @@ namespace HandyControl.Controls
|
|||||||
Axis = new Vector3D(1, 0, 0)
|
Axis = new Vector3D(1, 0, 0)
|
||||||
};
|
};
|
||||||
|
|
||||||
_animation = new DoubleAnimation(0, 180, new Duration(TimeSpan.FromSeconds(1)))
|
_animation = new DoubleAnimation(0, 180, new Duration(TimeSpan.FromSeconds(0.8)))
|
||||||
{
|
{
|
||||||
FillBehavior = FillBehavior.Stop
|
FillBehavior = FillBehavior.Stop
|
||||||
};
|
};
|
||||||
@@ -153,8 +155,12 @@ namespace HandyControl.Controls
|
|||||||
Children.Add(_content);
|
Children.Add(_content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool CheckNull() => _page1TextDown != null && _page2TextUp != null && _page2TextDown != null && _page3TextUp != null;
|
||||||
|
|
||||||
private void OnNumberChanged()
|
private void OnNumberChanged()
|
||||||
{
|
{
|
||||||
|
if (!CheckNull()) return;
|
||||||
|
|
||||||
InitNewNumber();
|
InitNewNumber();
|
||||||
|
|
||||||
if (_isAnimating)
|
if (_isAnimating)
|
||||||
|
|||||||
@@ -8,7 +8,6 @@ using System.Windows.Shell;
|
|||||||
using HandyControl.Data;
|
using HandyControl.Data;
|
||||||
using HandyControl.Tools;
|
using HandyControl.Tools;
|
||||||
|
|
||||||
// ReSharper disable once CheckNamespace
|
|
||||||
namespace HandyControl.Controls
|
namespace HandyControl.Controls
|
||||||
{
|
{
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -21,8 +20,8 @@ namespace HandyControl.Controls
|
|||||||
public static readonly DependencyProperty NonClientAreaContentProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty NonClientAreaContentProperty = DependencyProperty.Register(
|
||||||
"NonClientAreaContent", typeof(object), typeof(WindowBorderless), new PropertyMetadata(default(object)));
|
"NonClientAreaContent", typeof(object), typeof(WindowBorderless), new PropertyMetadata(default(object)));
|
||||||
|
|
||||||
public static readonly DependencyProperty CloseButtonHoverBrushProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty CloseButtonHoverBackgroundProperty = DependencyProperty.Register(
|
||||||
"CloseButtonHoverBrush", typeof(Brush), typeof(WindowBorderless),
|
"CloseButtonHoverBackground", typeof(Brush), typeof(WindowBorderless),
|
||||||
new PropertyMetadata(default(Brush)));
|
new PropertyMetadata(default(Brush)));
|
||||||
|
|
||||||
public static readonly DependencyProperty CloseButtonHoverForegroundProperty =
|
public static readonly DependencyProperty CloseButtonHoverForegroundProperty =
|
||||||
@@ -30,16 +29,22 @@ namespace HandyControl.Controls
|
|||||||
"CloseButtonHoverForeground", typeof(Brush), typeof(WindowBorderless),
|
"CloseButtonHoverForeground", typeof(Brush), typeof(WindowBorderless),
|
||||||
new PropertyMetadata(default(Brush)));
|
new PropertyMetadata(default(Brush)));
|
||||||
|
|
||||||
|
public static readonly DependencyProperty CloseButtonBackgroundProperty = DependencyProperty.Register(
|
||||||
|
"CloseButtonBackground", typeof(Brush), typeof(WindowBorderless), new PropertyMetadata(Brushes.Transparent));
|
||||||
|
|
||||||
public static readonly DependencyProperty CloseButtonForegroundProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty CloseButtonForegroundProperty = DependencyProperty.Register(
|
||||||
"CloseButtonForeground", typeof(Brush), typeof(WindowBorderless),
|
"CloseButtonForeground", typeof(Brush), typeof(WindowBorderless),
|
||||||
new PropertyMetadata(Brushes.White));
|
new PropertyMetadata(Brushes.White));
|
||||||
|
|
||||||
|
public static readonly DependencyProperty OtherButtonBackgroundProperty = DependencyProperty.Register(
|
||||||
|
"OtherButtonBackground", typeof(Brush), typeof(WindowBorderless), new PropertyMetadata(Brushes.Transparent));
|
||||||
|
|
||||||
public static readonly DependencyProperty OtherButtonForegroundProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty OtherButtonForegroundProperty = DependencyProperty.Register(
|
||||||
"OtherButtonForeground", typeof(Brush), typeof(WindowBorderless),
|
"OtherButtonForeground", typeof(Brush), typeof(WindowBorderless),
|
||||||
new PropertyMetadata(Brushes.White));
|
new PropertyMetadata(Brushes.White));
|
||||||
|
|
||||||
public static readonly DependencyProperty OtherButtonHoverBrushProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty OtherButtonHoverBackgroundProperty = DependencyProperty.Register(
|
||||||
"OtherButtonHoverBrush", typeof(Brush), typeof(WindowBorderless),
|
"OtherButtonHoverBackground", typeof(Brush), typeof(WindowBorderless),
|
||||||
new PropertyMetadata(default(Brush)));
|
new PropertyMetadata(default(Brush)));
|
||||||
|
|
||||||
public static readonly DependencyProperty OtherButtonHoverForegroundProperty =
|
public static readonly DependencyProperty OtherButtonHoverForegroundProperty =
|
||||||
@@ -144,12 +149,24 @@ namespace HandyControl.Controls
|
|||||||
Dispatcher.BeginInvoke(new Action(() => { SizeToContent = SizeToContent.WidthAndHeight; }));
|
Dispatcher.BeginInvoke(new Action(() => { SizeToContent = SizeToContent.WidthAndHeight; }));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Brush CloseButtonBackground
|
||||||
|
{
|
||||||
|
get => (Brush)GetValue(CloseButtonBackgroundProperty);
|
||||||
|
set => SetValue(CloseButtonBackgroundProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
public Brush CloseButtonForeground
|
public Brush CloseButtonForeground
|
||||||
{
|
{
|
||||||
get => (Brush)GetValue(CloseButtonForegroundProperty);
|
get => (Brush)GetValue(CloseButtonForegroundProperty);
|
||||||
set => SetValue(CloseButtonForegroundProperty, value);
|
set => SetValue(CloseButtonForegroundProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Brush OtherButtonBackground
|
||||||
|
{
|
||||||
|
get => (Brush)GetValue(OtherButtonBackgroundProperty);
|
||||||
|
set => SetValue(OtherButtonBackgroundProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
public Brush OtherButtonForeground
|
public Brush OtherButtonForeground
|
||||||
{
|
{
|
||||||
get => (Brush)GetValue(OtherButtonForegroundProperty);
|
get => (Brush)GetValue(OtherButtonForegroundProperty);
|
||||||
@@ -189,10 +206,10 @@ namespace HandyControl.Controls
|
|||||||
set => SetValue(NonClientAreaContentProperty, value);
|
set => SetValue(NonClientAreaContentProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Brush CloseButtonHoverBrush
|
public Brush CloseButtonHoverBackground
|
||||||
{
|
{
|
||||||
get => (Brush)GetValue(CloseButtonHoverBrushProperty);
|
get => (Brush)GetValue(CloseButtonHoverBackgroundProperty);
|
||||||
set => SetValue(CloseButtonHoverBrushProperty, value);
|
set => SetValue(CloseButtonHoverBackgroundProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Brush CloseButtonHoverForeground
|
public Brush CloseButtonHoverForeground
|
||||||
@@ -201,10 +218,10 @@ namespace HandyControl.Controls
|
|||||||
set => SetValue(CloseButtonHoverForegroundProperty, value);
|
set => SetValue(CloseButtonHoverForegroundProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Brush OtherButtonHoverBrush
|
public Brush OtherButtonHoverBackground
|
||||||
{
|
{
|
||||||
get => (Brush)GetValue(OtherButtonHoverBrushProperty);
|
get => (Brush)GetValue(OtherButtonHoverBackgroundProperty);
|
||||||
set => SetValue(OtherButtonHoverBrushProperty, value);
|
set => SetValue(OtherButtonHoverBackgroundProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Brush OtherButtonHoverForeground
|
public Brush OtherButtonHoverForeground
|
||||||
|
|||||||
@@ -94,6 +94,7 @@
|
|||||||
<Compile Include="Controls\Other\InternalCanvas.cs" />
|
<Compile Include="Controls\Other\InternalCanvas.cs" />
|
||||||
<Compile Include="Controls\StepBar\StepBar.cs" />
|
<Compile Include="Controls\StepBar\StepBar.cs" />
|
||||||
<Compile Include="Controls\StepBar\StepBarItem.cs" />
|
<Compile Include="Controls\StepBar\StepBarItem.cs" />
|
||||||
|
<Compile Include="Controls\Time\FlipClock\FlipClock.cs" />
|
||||||
<Compile Include="Controls\Time\FlipClock\FlipNumber.cs" />
|
<Compile Include="Controls\Time\FlipClock\FlipNumber.cs" />
|
||||||
<Compile Include="Data\Args\CancelRoutedEventArgs.cs" />
|
<Compile Include="Data\Args\CancelRoutedEventArgs.cs" />
|
||||||
<Compile Include="Data\Enum\InfoType.cs" />
|
<Compile Include="Data\Enum\InfoType.cs" />
|
||||||
@@ -316,7 +317,7 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="Themes\Styles\FlipNumber.xaml">
|
<Page Include="Themes\Styles\FlipClock.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -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>
|
|
||||||
@@ -47,7 +47,7 @@
|
|||||||
<ResourceDictionary Source="SearchBar.xaml"/>
|
<ResourceDictionary Source="SearchBar.xaml"/>
|
||||||
<ResourceDictionary Source="Tag.xaml"/>
|
<ResourceDictionary Source="Tag.xaml"/>
|
||||||
<ResourceDictionary Source="RadioGroup.xaml"/>
|
<ResourceDictionary Source="RadioGroup.xaml"/>
|
||||||
<ResourceDictionary Source="FlipNumber.xaml"/>
|
<ResourceDictionary Source="FlipClock.xaml"/>
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -24,10 +24,12 @@
|
|||||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||||
<Setter Property="NonClientAreaBackground" Value="{DynamicResource TitleBrush}"/>
|
<Setter Property="NonClientAreaBackground" Value="{DynamicResource TitleBrush}"/>
|
||||||
<Setter Property="NonClientAreaForeground" Value="White"/>
|
<Setter Property="NonClientAreaForeground" Value="White"/>
|
||||||
<Setter Property="CloseButtonHoverBrush" Value="Red"/>
|
<Setter Property="CloseButtonHoverBackground" Value="Red"/>
|
||||||
<Setter Property="CloseButtonHoverForeground" Value="White"/>
|
<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="OtherButtonHoverForeground" Value="White"/>
|
||||||
|
<Setter Property="OtherButtonBackground" Value="Transparent"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="controls:WindowBorderless">
|
<ControlTemplate TargetType="controls:WindowBorderless">
|
||||||
@@ -43,10 +45,10 @@
|
|||||||
<ColumnDefinition Width="Auto"/>
|
<ColumnDefinition Width="Auto"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
<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 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 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.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 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 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 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>
|
</StackPanel>
|
||||||
<Grid Grid.Column="0">
|
<Grid Grid.Column="0">
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
@@ -86,19 +88,19 @@
|
|||||||
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
<Setter Property="Visibility" Value="Collapsed" TargetName="ButtonRestore"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonClose">
|
<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}}"/>
|
<Setter Property="Foreground" TargetName="ButtonClose" Value="{Binding CloseButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMax">
|
<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}}"/>
|
<Setter Property="Foreground" TargetName="ButtonMax" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonRestore">
|
<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}}"/>
|
<Setter Property="Foreground" TargetName="ButtonRestore" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsMouseOver" Value="True" SourceName="ButtonMin">
|
<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}}"/>
|
<Setter Property="Foreground" TargetName="ButtonMin" Value="{Binding OtherButtonHoverForeground,RelativeSource={RelativeSource Mode=TemplatedParent}}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="ShowNonClientArea" Value="False">
|
<Trigger Property="ShowNonClientArea" Value="False">
|
||||||
|
|||||||
@@ -58,7 +58,7 @@
|
|||||||
|
|
||||||
public static readonly string OutlineTextDemoCtl = nameof(OutlineTextDemoCtl);
|
public static readonly string OutlineTextDemoCtl = nameof(OutlineTextDemoCtl);
|
||||||
|
|
||||||
public static readonly string FlipNumberDemoCtl = nameof(FlipNumberDemoCtl);
|
public static readonly string FlipClockDemoCtl = nameof(FlipClockDemoCtl);
|
||||||
|
|
||||||
public static readonly string QQGroupView = nameof(QQGroupView);
|
public static readonly string QQGroupView = nameof(QQGroupView);
|
||||||
|
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ var controlList = new List<string>
|
|||||||
"TagDemoCtl",
|
"TagDemoCtl",
|
||||||
"GifImageDemoCtl",
|
"GifImageDemoCtl",
|
||||||
"OutlineTextDemoCtl",
|
"OutlineTextDemoCtl",
|
||||||
"FlipNumberDemoCtl",
|
"FlipClockDemoCtl",
|
||||||
"QQGroupView"
|
"QQGroupView"
|
||||||
};
|
};
|
||||||
var styleList = new List<string>
|
var styleList = new List<string>
|
||||||
|
|||||||
@@ -142,8 +142,8 @@
|
|||||||
<Compile Include="UserControl\Controls\DateTimePickerDemoCtl.xaml.cs">
|
<Compile Include="UserControl\Controls\DateTimePickerDemoCtl.xaml.cs">
|
||||||
<DependentUpon>DateTimePickerDemoCtl.xaml</DependentUpon>
|
<DependentUpon>DateTimePickerDemoCtl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="UserControl\Controls\FlipNumberDemoCtl.xaml.cs">
|
<Compile Include="UserControl\Controls\FlipClockDemoCtl.xaml.cs">
|
||||||
<DependentUpon>FlipNumberDemoCtl.xaml</DependentUpon>
|
<DependentUpon>FlipClockDemoCtl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
<Compile Include="UserControl\Controls\OutlineTextDemoCtl.xaml.cs">
|
<Compile Include="UserControl\Controls\OutlineTextDemoCtl.xaml.cs">
|
||||||
<DependentUpon>OutlineTextDemoCtl.xaml</DependentUpon>
|
<DependentUpon>OutlineTextDemoCtl.xaml</DependentUpon>
|
||||||
@@ -408,7 +408,7 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="UserControl\Controls\FlipNumberDemoCtl.xaml">
|
<Page Include="UserControl\Controls\FlipClockDemoCtl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -9,7 +9,7 @@
|
|||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
BorderBrush="#262e2f"
|
BorderBrush="#262e2f"
|
||||||
NonClientAreaBackground="#262e2f"
|
NonClientAreaBackground="#262e2f"
|
||||||
OtherButtonHoverBrush="#888580"
|
OtherButtonHoverBackground="#888580"
|
||||||
Style="{StaticResource CustomWindowStyle}"
|
Style="{StaticResource CustomWindowStyle}"
|
||||||
WindowState="Maximized"
|
WindowState="Maximized"
|
||||||
Title="MainWindow"
|
Title="MainWindow"
|
||||||
|
|||||||
+3
-3
@@ -385,11 +385,11 @@ namespace HandyControlDemo.Properties.Langs {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 翻页数字 的本地化字符串。
|
/// 查找类似 翻页时钟 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static string FlipNumber {
|
public static string FlipClock {
|
||||||
get {
|
get {
|
||||||
return ResourceManager.GetString("FlipNumber", resourceCulture);
|
return ResourceManager.GetString("FlipClock", resourceCulture);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -435,10 +435,10 @@
|
|||||||
<data name="OutlineText" xml:space="preserve">
|
<data name="OutlineText" xml:space="preserve">
|
||||||
<value>OutlineText</value>
|
<value>OutlineText</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FlipNumber" xml:space="preserve">
|
|
||||||
<value>FlipNumber</value>
|
|
||||||
</data>
|
|
||||||
<data name="QQGroup" xml:space="preserve">
|
<data name="QQGroup" xml:space="preserve">
|
||||||
<value>QQ Group</value>
|
<value>QQ Group</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="FlipClock" xml:space="preserve">
|
||||||
|
<value>FlipClock</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -415,10 +415,10 @@
|
|||||||
<data name="OutlineText" xml:space="preserve">
|
<data name="OutlineText" xml:space="preserve">
|
||||||
<value>轮廓文本</value>
|
<value>轮廓文本</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="FlipNumber" xml:space="preserve">
|
|
||||||
<value>翻页数字</value>
|
|
||||||
</data>
|
|
||||||
<data name="QQGroup" xml:space="preserve">
|
<data name="QQGroup" xml:space="preserve">
|
||||||
<value>QQ群</value>
|
<value>QQ群</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="FlipClock" xml:space="preserve">
|
||||||
|
<value>翻页时钟</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
<UserControl x:Class="HandyControlDemo.UserControl.FlipClockDemoCtl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
Background="{DynamicResource RegionBrush}"
|
||||||
|
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl">
|
||||||
|
<controls:TransitioningContentControl>
|
||||||
|
<controls:FlipClock Margin="32"/>
|
||||||
|
</controls:TransitioningContentControl>
|
||||||
|
</UserControl>
|
||||||
+2
-2
@@ -1,8 +1,8 @@
|
|||||||
namespace HandyControlDemo.UserControl
|
namespace HandyControlDemo.UserControl
|
||||||
{
|
{
|
||||||
public partial class FlipNumberDemoCtl
|
public partial class FlipClockDemoCtl
|
||||||
{
|
{
|
||||||
public FlipNumberDemoCtl()
|
public FlipClockDemoCtl()
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
}
|
}
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
<UserControl x:Class="HandyControlDemo.UserControl.FlipNumberDemoCtl"
|
|
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
||||||
Background="{DynamicResource RegionBrush}"
|
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl">
|
|
||||||
<controls:TransitioningContentControl>
|
|
||||||
<Grid Margin="32">
|
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<RowDefinition/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
<controls:NumericUpDown x:Name="UpDown" Minimum="0" Maximum="9"/>
|
|
||||||
<controls:FlipNumber Number="{Binding Value,ElementName=UpDown}" Grid.Row="1" Margin="0,16,0,0"/>
|
|
||||||
</Grid>
|
|
||||||
</controls:TransitioningContentControl>
|
|
||||||
</UserControl>
|
|
||||||
@@ -189,7 +189,7 @@
|
|||||||
<Image Source="../../Resources/Img/LeftMainContent/DatePicker_16x.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/DatePicker_16x.png"/>
|
||||||
</controls:EdgeElement.LeftContent>
|
</controls:EdgeElement.LeftContent>
|
||||||
</ListBoxItem>
|
</ListBoxItem>
|
||||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.FlipNumberDemoCtl}" Content="{x:Static langs:Lang.FlipNumber}">
|
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.FlipClockDemoCtl}" Content="{x:Static langs:Lang.FlipClock}">
|
||||||
<controls:EdgeElement.LeftContent>
|
<controls:EdgeElement.LeftContent>
|
||||||
<Image Source="../../Resources/Img/LeftMainContent/FlipVertical_16x.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/FlipVertical_16x.png"/>
|
||||||
</controls:EdgeElement.LeftContent>
|
</controls:EdgeElement.LeftContent>
|
||||||
|
|||||||
@@ -8,7 +8,7 @@
|
|||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
OtherButtonForeground="{DynamicResource ReverseTextBrush}"
|
OtherButtonForeground="{DynamicResource ReverseTextBrush}"
|
||||||
CloseButtonForeground="{DynamicResource ReverseTextBrush}"
|
CloseButtonForeground="{DynamicResource ReverseTextBrush}"
|
||||||
OtherButtonHoverBrush="{DynamicResource ReverseTextBrush}"
|
OtherButtonHoverBackground="{DynamicResource ReverseTextBrush}"
|
||||||
NonClientAreaBackground="{DynamicResource ToolBarBackground}"
|
NonClientAreaBackground="{DynamicResource ToolBarBackground}"
|
||||||
NonClientAreaHeight="69"
|
NonClientAreaHeight="69"
|
||||||
Background="{DynamicResource MainContentBackgroundBrush}"
|
Background="{DynamicResource MainContentBackgroundBrush}"
|
||||||
|
|||||||
@@ -10,6 +10,12 @@
|
|||||||
|
|
||||||
## Latest examples
|
## Latest examples
|
||||||
|
|
||||||
|
### FlipClock
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
|
## History publication
|
||||||
|
|
||||||
### OutlineText
|
### OutlineText
|
||||||
|
|
||||||

|

|
||||||
@@ -30,8 +36,6 @@
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
## History publication
|
|
||||||
|
|
||||||
### ButtonStyle
|
### ButtonStyle
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 125 KiB |
Reference in new issue
Block a user