diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
index a97f4544..0e7f7718 100644
--- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
+++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems
@@ -45,6 +45,9 @@
TextDialog.xaml
+
+ TextDialogWithTimer.xaml
+
AnimationPathDemoCtl.xaml
@@ -405,6 +408,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 a358c168..1ef33d47 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs
@@ -1410,6 +1410,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
+ ///
+ /// 查找类似 文本对话框,带计时器 的本地化字符串。
+ ///
+ public static string TextDialogWithTimer {
+ get {
+ return ResourceManager.GetString("TextDialogWithTimer", resourceCulture);
+ }
+ }
+
///
/// 查找类似 时间条 的本地化字符串。
///
diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
index e20eda66..4298ede4 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx
@@ -624,4 +624,7 @@
Card
+
+ TextDialog with timer
+
\ 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 04bf9e02..e5cabbbb 100644
--- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
+++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx
@@ -624,4 +624,7 @@
卡片
+
+ 文本对话框,带计时器
+
\ No newline at end of file
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml
index 6b22e2ef..2615146f 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/ChatBox.xaml
@@ -37,7 +37,7 @@
-
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/InteractiveDialog.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/InteractiveDialog.xaml
index 161cb16a..223780ec 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/InteractiveDialog.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/InteractiveDialog.xaml
@@ -1,4 +1,4 @@
-
+
+
+
+
+
+
+
+
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Basic/TextDialogWithTimer.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/TextDialogWithTimer.xaml.cs
new file mode 100644
index 00000000..73765ea6
--- /dev/null
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Basic/TextDialogWithTimer.xaml.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Windows.Controls.Primitives;
+using HandyControl.Tools;
+
+namespace HandyControlDemo.UserControl
+{
+ public partial class TextDialogWithTimer
+ {
+ public TextDialogWithTimer()
+ {
+ InitializeComponent();
+
+ var animation = AnimationHelper.CreateAnimation(100, 5000);
+ animation.EasingFunction = null;
+ animation.Completed += Animation_Completed;
+ ProgressBarTimer.BeginAnimation(RangeBase.ValueProperty, animation);
+ }
+
+ private void Animation_Completed(object sender, EventArgs e)
+ {
+ ButtonClose.Command.Execute(null);
+ }
+ }
+}
diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DialogDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DialogDemoCtl.xaml
index 21072d9a..c8973990 100644
--- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DialogDemoCtl.xaml
+++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DialogDemoCtl.xaml
@@ -9,6 +9,7 @@
+
diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs
index 30efe414..947ee7bc 100644
--- a/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs
+++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Basic/InteractiveDialogViewModel.cs
@@ -6,6 +6,7 @@ using GalaSoft.MvvmLight.Command;
using GalaSoft.MvvmLight.CommandWpf;
#endif
using HandyControl.Tools.Extension;
+using HandyControlDemo.Data;
namespace HandyControlDemo.ViewModel.Basic
{
@@ -37,6 +38,6 @@ namespace HandyControlDemo.ViewModel.Basic
#endif
}
- public RelayCommand CloseCmd => new Lazy(() => new RelayCommand(() => CloseAction?.Invoke(""))).Value;
+ public RelayCommand CloseCmd => new Lazy(() => new RelayCommand(() => CloseAction?.Invoke(MessageToken.MainWindow))).Value;
}
}
diff --git a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs
index 4b6910a8..89bc2d92 100644
--- a/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs
+++ b/src/Shared/HandyControlDemo_Shared/ViewModel/Controls/DialogDemoViewModel.cs
@@ -10,7 +10,6 @@ using GalaSoft.MvvmLight.CommandWpf;
using HandyControl.Controls;
using HandyControl.Tools.Extension;
using HandyControlDemo.UserControl;
-using HandyControlDemo.UserControl.Basic;
using HandyControlDemo.ViewModel.Basic;
using HandyControlDemo.Window;
@@ -39,24 +38,38 @@ namespace HandyControlDemo.ViewModel
}
#if netle40
- public RelayCommand ShowInteractiveDialogCmd => new Lazy(() =>
- new RelayCommand(ShowInteractiveDialog)).Value;
+ public RelayCommand ShowInteractiveDialogCmd => new Lazy>(() =>
+ new RelayCommand(ShowInteractiveDialog)).Value;
- private void ShowInteractiveDialog()
+ private void ShowInteractiveDialog(bool withTimer)
{
- Dialog.Show()
- .Initialize(vm => vm.Message = DialogResult)
- .GetResultAsync().ContinueWith(str => DialogResult = str.Result);
+ if (!withTimer)
+ {
+ Dialog.Show()
+ .Initialize(vm => vm.Message = DialogResult)
+ .GetResultAsync().ContinueWith(str => DialogResult = str.Result);
+ }
+ else
+ {
+ Dialog.Show().GetResultAsync();
+ }
}
#else
- public RelayCommand ShowInteractiveDialogCmd => new Lazy(() =>
- new RelayCommand(async () => await ShowInteractiveDialog())).Value;
+ public RelayCommand ShowInteractiveDialogCmd => new Lazy>(() =>
+ new RelayCommand(async withTimer => await ShowInteractiveDialog(withTimer))).Value;
- private async Task ShowInteractiveDialog()
+ private async Task ShowInteractiveDialog(bool withTimer)
{
- DialogResult = await Dialog.Show()
- .Initialize(vm => vm.Message = DialogResult)
- .GetResultAsync();
+ if (!withTimer)
+ {
+ DialogResult = await Dialog.Show()
+ .Initialize(vm => vm.Message = DialogResult)
+ .GetResultAsync();
+ }
+ else
+ {
+ await Dialog.Show().GetResultAsync();
+ }
}
#endif