diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
index efb97896..bd47b261 100644
--- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
+++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj
@@ -402,6 +402,9 @@
Resources\Img\LeftMainContent\HandyControl.png
+
+ Resources\Img\LeftMainContent\Procedure_16x.png
+
Resources\Img\Dance.png
diff --git a/src/Core_30/HandyControl_Core_30/Themes/Styles/Base/ComboBoxBaseStyle.xaml b/src/Core_30/HandyControl_Core_30/Themes/Styles/Base/ComboBoxBaseStyle.xaml
index d8f26026..ec88f225 100644
--- a/src/Core_30/HandyControl_Core_30/Themes/Styles/Base/ComboBoxBaseStyle.xaml
+++ b/src/Core_30/HandyControl_Core_30/Themes/Styles/Base/ComboBoxBaseStyle.xaml
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
index 530c4e9d..061ee976 100644
--- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
+++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj
@@ -417,6 +417,9 @@
TextTemplatingFileGenerator
MessageToken.cs
+
+ Resources\Img\LeftMainContent\Procedure_16x.png
+
Resources\Img\LeftMainContent\HandyControl.png
diff --git a/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/ComboBoxBaseStyle.xaml b/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/ComboBoxBaseStyle.xaml
index afbb2390..96d3122e 100644
--- a/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/ComboBoxBaseStyle.xaml
+++ b/src/Net_40/HandyControl_Net_40/Themes/Styles/Base/ComboBoxBaseStyle.xaml
@@ -5,7 +5,6 @@
xmlns:interactivity="clr-namespace:HandyControl.Interactivity">
-
@@ -21,9 +20,9 @@
-
-
-
+
+
+
@@ -54,9 +53,9 @@
-
-
-
+
+
+
@@ -83,12 +82,12 @@
-
-
+
+
@@ -139,12 +138,12 @@
-
-
+
+
-
-
+
+
@@ -186,19 +185,19 @@
-
+
-
-
+
+
-
-
+
+
@@ -261,17 +260,17 @@
-
-
+
+
-
-
+
+
-
+
@@ -320,12 +319,12 @@
-
-
+
+
-
-
+
+
@@ -370,19 +369,19 @@
-
+
-
-
+
+
-
-
+
+
@@ -470,11 +469,11 @@
-
+
-
+
@@ -520,10 +519,10 @@
-
+
-
+
@@ -542,16 +541,16 @@
-
-
+
+
-
-
+
+
-
+
@@ -617,10 +616,10 @@
-
+
-
+
@@ -629,23 +628,23 @@
-
+
-
-
+
+
-
-
+
+
-
+
@@ -711,10 +710,10 @@
-
+
-
+
@@ -733,16 +732,16 @@
-
-
+
+
-
-
+
+
-
+
@@ -963,10 +962,10 @@
-
+
-
+
@@ -975,23 +974,23 @@
-
+
-
-
+
+
-
-
+
+
-
+
diff --git a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
index a2e724d7..960af279 100644
--- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
+++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj
@@ -480,6 +480,9 @@
TextTemplatingFileGenerator
MessageToken.cs
+
+ Resources\Img\LeftMainContent\Procedure_16x.png
+
Resources\Img\LeftMainContent\HandyControl.png
diff --git a/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/Base/ComboBoxBaseStyle.xaml b/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/Base/ComboBoxBaseStyle.xaml
index d8f26026..ec88f225 100644
--- a/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/Base/ComboBoxBaseStyle.xaml
+++ b/src/Net_GE45/HandyControl_Net_GE45/Themes/Styles/Base/ComboBoxBaseStyle.xaml
@@ -22,7 +22,7 @@
-
+
diff --git a/src/Shared/HandyControlDemo_Shared/App.xaml b/src/Shared/HandyControlDemo_Shared/App.xaml
index cdd77978..a9f0c1ee 100644
--- a/src/Shared/HandyControlDemo_Shared/App.xaml
+++ b/src/Shared/HandyControlDemo_Shared/App.xaml
@@ -6,6 +6,7 @@
xmlns:d1P1="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:data="clr-namespace:HandyControlDemo.Data"
+ xmlns:hc="https://handyorg.github.io/handycontrol"
d1P1:Ignorable="d"
StartupUri="MainWindow.xaml">
@@ -35,6 +36,12 @@
+
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs
index 1e09db7a..982af49c 100644
--- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs
+++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs
@@ -112,6 +112,8 @@
public static readonly string SpriteDemoCtl = nameof(SpriteDemoCtl);
+ public static readonly string NotificationDemoCtl = nameof(NotificationDemoCtl);
+
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt
index 5562e803..c3f93c36 100644
--- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt
+++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt
@@ -58,7 +58,8 @@ var controlList = new List
"ImageBlockDemoCtl",
"RunningBlockDemoCtl",
"HoneycombPanelDemoCtl",
- "SpriteDemoCtl"
+ "SpriteDemoCtl",
+ "NotificationDemoCtl"
};
var styleList = new List
{
diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
index 984abb9a..8f0d5303 100644
--- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
+++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
@@ -63,6 +63,9 @@
MagnifierDemoCtl.xaml
+
+ NotificationDemoCtl.xaml
+
RangeSliderDemoCtl.xaml
@@ -207,6 +210,9 @@
WindowDemoCtl.xaml
+
+ AppNotification.xaml
+
BlogsView.xaml
@@ -324,6 +330,7 @@
+
@@ -451,6 +458,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
@@ -643,6 +654,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
index 43270cfc..65dbbbaa 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
@@ -852,6 +852,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 桌面通知 的本地化字符串。
+ ///
+ public static string Notification {
+ get {
+ return ResourceManager.GetString("Notification", resourceCulture);
+ }
+ }
+
///
/// 查找类似 托盘图标 的本地化字符串。
///
@@ -1320,6 +1329,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 发送通知 的本地化字符串。
+ ///
+ public static string SendNotification {
+ get {
+ return ResourceManager.GetString("SendNotification", resourceCulture);
+ }
+ }
+
///
/// 查找类似 徽章 的本地化字符串。
///
@@ -1383,6 +1401,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 保持打开 的本地化字符串。
+ ///
+ public static string StaysOpen {
+ get {
+ return ResourceManager.GetString("StaysOpen", resourceCulture);
+ }
+ }
+
///
/// 查找类似 步骤 的本地化字符串。
///
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
index 3efb365c..7c939565 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
@@ -651,4 +651,13 @@
Open sprite
+
+ Notification
+
+
+ Send notification
+
+
+ Stays open
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
index 6b168ea6..5c46a76d 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
@@ -651,4 +651,13 @@
打开精灵
+
+ 桌面通知
+
+
+ 发送通知
+
+
+ 保持打开
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/Procedure_16x.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/Procedure_16x.png
new file mode 100644
index 00000000..70f60143
Binary files /dev/null and b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/Procedure_16x.png differ
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NotificationDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NotificationDemoCtl.xaml
new file mode 100644
index 00000000..0f0cdf27
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NotificationDemoCtl.xaml
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NotificationDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NotificationDemoCtl.xaml.cs
new file mode 100644
index 00000000..4a86ef88
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/NotificationDemoCtl.xaml.cs
@@ -0,0 +1,10 @@
+namespace HandyControlDemo.UserControl
+{
+ public partial class NotificationDemoCtl
+ {
+ public NotificationDemoCtl()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/AppNotification.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Main/AppNotification.xaml
new file mode 100644
index 00000000..f9183960
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/AppNotification.xaml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/AppNotification.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Main/AppNotification.xaml.cs
new file mode 100644
index 00000000..ffc76c31
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/AppNotification.xaml.cs
@@ -0,0 +1,10 @@
+namespace HandyControlDemo.UserControl
+{
+ public partial class AppNotification
+ {
+ public AppNotification()
+ {
+ InitializeComponent();
+ }
+ }
+}
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml
index 9f3b9c51..92ecd073 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml
@@ -200,7 +200,7 @@
-
+
@@ -450,6 +450,11 @@
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs
index 2406d7a3..d9a19626 100644
--- a/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs
+++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs
@@ -7,7 +7,7 @@ using GalaSoft.MvvmLight.CommandWpf;
#endif
using HandyControl.Tools.Extension;
-namespace HandyControlDemo.ViewModel.Basic
+namespace HandyControlDemo.ViewModel
{
public class InteractiveDialogViewModel : ViewModelBase, IDialogResultable
{
diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/BadgeDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/BadgeDemoViewModel.cs
index ada4f4fe..5570cc4e 100644
--- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/BadgeDemoViewModel.cs
+++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/BadgeDemoViewModel.cs
@@ -6,7 +6,7 @@ using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.CommandWpf;
#endif
-namespace HandyControlDemo.ViewModel.Controls
+namespace HandyControlDemo.ViewModel
{
public class BadgeDemoViewModel : ViewModelBase
{
diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs
index cb149c85..e3c1a08e 100644
--- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs
+++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs
@@ -11,7 +11,6 @@ using HandyControl.Controls;
using HandyControl.Tools.Extension;
using HandyControlDemo.Data;
using HandyControlDemo.UserControl;
-using HandyControlDemo.ViewModel.Basic;
using HandyControlDemo.Window;
namespace HandyControlDemo.ViewModel
diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/NotificationDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/NotificationDemoViewModel.cs
new file mode 100644
index 00000000..8e005cf1
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/NotificationDemoViewModel.cs
@@ -0,0 +1,35 @@
+#if netle40
+using GalaSoft.MvvmLight.Command;
+#else
+using GalaSoft.MvvmLight.CommandWpf;
+# endif
+using System;
+using GalaSoft.MvvmLight;
+using HandyControl.Controls;
+using HandyControl.Data;
+using HandyControlDemo.UserControl;
+
+namespace HandyControlDemo.ViewModel
+{
+ public class NotificationDemoViewModel : ViewModelBase
+ {
+ public RelayCommand OpenCmd => new Lazy(() =>
+ new RelayCommand(() => Notification.Show(new AppNotification(), ShowAnimation, StaysOpen))).Value;
+
+ private ShowAnimation _showAnimation;
+
+ public ShowAnimation ShowAnimation
+ {
+ get => _showAnimation;
+ set => Set(ref _showAnimation, value);
+ }
+
+ private bool _staysOpen = true;
+
+ public bool StaysOpen
+ {
+ get => _staysOpen;
+ set => Set(ref _staysOpen, value);
+ }
+ }
+}
diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SpriteDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SpriteDemoViewModel.cs
index 46d154ab..b6bc4fe0 100644
--- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SpriteDemoViewModel.cs
+++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/SpriteDemoViewModel.cs
@@ -1,5 +1,4 @@
using System;
-using GalaSoft.MvvmLight;
using HandyControl.Controls;
using HandyControlDemo.UserControl;
#if netle40
@@ -8,9 +7,9 @@ using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.CommandWpf;
# endif
-namespace HandyControlDemo
+namespace HandyControlDemo.ViewModel
{
- public class SpriteDemoViewModel : ViewModelBase
+ public class SpriteDemoViewModel
{
public RelayCommand OpenCmd => new Lazy(() =>
new RelayCommand(()=> Sprite.Show(new AppSprite()))).Value;
diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/ViewModelLocator.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/ViewModelLocator.cs
index a623d046..d8e4b51f 100644
--- a/src/Shared/HandyControlDemo_Shared/ViewModel/ViewModelLocator.cs
+++ b/src/Shared/HandyControlDemo_Shared/ViewModel/ViewModelLocator.cs
@@ -4,8 +4,6 @@ using CommonServiceLocator;
using GalaSoft.MvvmLight.Ioc;
using HandyControlDemo.Data;
using HandyControlDemo.Service;
-using HandyControlDemo.ViewModel.Basic;
-using HandyControlDemo.ViewModel.Controls;
namespace HandyControlDemo.ViewModel
{
@@ -40,6 +38,7 @@ namespace HandyControlDemo.ViewModel
SimpleIoc.Default.Register();
SimpleIoc.Default.Register();
SimpleIoc.Default.Register();
+ SimpleIoc.Default.Register();
}
public static ViewModelLocator Instance => new Lazy(() =>
@@ -93,6 +92,8 @@ namespace HandyControlDemo.ViewModel
public SpriteDemoViewModel SpriteDemo => ServiceLocator.Current.GetInstance();
+ public NotificationDemoViewModel NotificationDemo => ServiceLocator.Current.GetInstance();
+
#endregion
}
}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Notification.cs b/src/Shared/HandyControl_Shared/Controls/Other/Notification.cs
new file mode 100644
index 00000000..11a05e84
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Controls/Other/Notification.cs
@@ -0,0 +1,155 @@
+using System;
+using System.ComponentModel;
+using System.Threading.Tasks;
+using System.Windows;
+using System.Windows.Threading;
+using HandyControl.Data;
+using HandyControl.Tools;
+
+namespace HandyControl.Controls
+{
+ public sealed class Notification : System.Windows.Window
+ {
+ private const int WaitTime = 6;
+
+ ///
+ /// 计数
+ ///
+ private int _tickCount;
+
+ ///
+ /// 关闭计时器
+ ///
+ private DispatcherTimer _timerClose;
+
+ private ShowAnimation ShowAnimation { get; set; }
+
+ private bool _shouldBeClosed;
+
+ public Notification()
+ {
+ WindowStyle = WindowStyle.None;
+ AllowsTransparency = true;
+ }
+
+ public static Notification Show(object content, ShowAnimation showAnimation = ShowAnimation.None, bool staysOpen = false)
+ {
+ var notification = new Notification
+ {
+ Content = content,
+ Opacity = 0,
+ ShowAnimation = showAnimation
+ };
+
+ notification.Show();
+
+ var desktopWorkingArea = SystemParameters.WorkArea;
+ var leftMax = desktopWorkingArea.Width - notification.ActualWidth;
+ var topMax = desktopWorkingArea.Height - notification.ActualHeight;
+
+ switch (showAnimation)
+ {
+ case ShowAnimation.None:
+ notification.Opacity = 1;
+ notification.Left = leftMax;
+ notification.Top = topMax;
+ break;
+ case ShowAnimation.HorizontalMove:
+ notification.Opacity = 1;
+ notification.Left = desktopWorkingArea.Width;
+ notification.Top = topMax;
+ notification.BeginAnimation(LeftProperty, AnimationHelper.CreateAnimation(leftMax));
+ break;
+ case ShowAnimation.verticalMove:
+ notification.Opacity = 1;
+ notification.Left = leftMax;
+ notification.Top = desktopWorkingArea.Height;
+ notification.BeginAnimation(TopProperty, AnimationHelper.CreateAnimation(topMax));
+ break;
+ case ShowAnimation.Fade:
+ notification.Left = leftMax;
+ notification.Top = topMax;
+ notification.BeginAnimation(OpacityProperty, AnimationHelper.CreateAnimation(1));
+ break;
+ default:
+ notification.Opacity = 1;
+ notification.Left = leftMax;
+ notification.Top = topMax;
+ break;
+ }
+
+ if (!staysOpen) notification.StartTimer();
+
+ return notification;
+ }
+
+ protected override void OnClosing(CancelEventArgs e)
+ {
+ base.OnClosing(e);
+
+ if (_shouldBeClosed)
+ {
+ return;
+ }
+ var desktopWorkingArea = SystemParameters.WorkArea;
+
+ switch (ShowAnimation)
+ {
+ case ShowAnimation.None:
+ break;
+ case ShowAnimation.HorizontalMove:
+ {
+ var animation = AnimationHelper.CreateAnimation(desktopWorkingArea.Width);
+ animation.Completed += Animation_Completed;
+ BeginAnimation(LeftProperty, animation);
+ e.Cancel = true;
+ _shouldBeClosed = true;
+ }
+ break;
+ case ShowAnimation.verticalMove:
+ {
+ var animation = AnimationHelper.CreateAnimation(desktopWorkingArea.Height);
+ animation.Completed += Animation_Completed;
+ BeginAnimation(TopProperty, animation);
+ e.Cancel = true;
+ _shouldBeClosed = true;
+ }
+ break;
+ case ShowAnimation.Fade:
+ {
+ var animation = AnimationHelper.CreateAnimation(0);
+ animation.Completed += Animation_Completed;
+ BeginAnimation(OpacityProperty, animation);
+ e.Cancel = true;
+ _shouldBeClosed = true;
+ }
+ break;
+ }
+ }
+
+ private void Animation_Completed(object sender, EventArgs e) => Close();
+
+ ///
+ /// 开始计时器
+ ///
+ private void StartTimer()
+ {
+ _timerClose = new DispatcherTimer
+ {
+ Interval = TimeSpan.FromSeconds(1)
+ };
+ _timerClose.Tick += delegate
+ {
+ if (IsMouseOver)
+ {
+ _tickCount = 0;
+ return;
+ }
+
+ _tickCount++;
+ if (_tickCount >= WaitTime) Close();
+ };
+ _timerClose.Start();
+ }
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Data/Enum/ShowAnimation.cs b/src/Shared/HandyControl_Shared/Data/Enum/ShowAnimation.cs
new file mode 100644
index 00000000..ba230aae
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Data/Enum/ShowAnimation.cs
@@ -0,0 +1,10 @@
+namespace HandyControl.Data
+{
+ public enum ShowAnimation
+ {
+ None,
+ HorizontalMove,
+ verticalMove,
+ Fade
+ }
+}
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
index 09c934eb..f6f529e4 100644
--- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
+++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems
@@ -24,6 +24,7 @@
+
@@ -31,6 +32,7 @@
+
@@ -688,6 +690,10 @@
Designer
MSBuild:Compile
+
+ Designer
+ MSBuild:Compile
+
Designer
MSBuild:Compile
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Notification.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Notification.xaml
new file mode 100644
index 00000000..04559201
--- /dev/null
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Notification.xaml
@@ -0,0 +1,22 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
index a7ccfe6f..93b2485a 100644
--- a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
+++ b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml
@@ -72,6 +72,7 @@
+
\ No newline at end of file