improved dialog
This commit is contained in:
1 parent
76a886c331
commit
745909f485
16 files changed
+219
-11
No files matched your search
@@ -11,7 +11,7 @@ namespace HandyControlDemo.ViewModel.Basic
|
||||
{
|
||||
public class InteractiveDialogViewModel : ViewModelBase, IDialogResultable<string>
|
||||
{
|
||||
public Action CloseAction { get; set; }
|
||||
public Action<string> CloseAction { get; set; }
|
||||
|
||||
private string _result;
|
||||
|
||||
@@ -37,6 +37,6 @@ namespace HandyControlDemo.ViewModel.Basic
|
||||
#endif
|
||||
}
|
||||
|
||||
public RelayCommand CloseCmd => new Lazy<RelayCommand>(() => new RelayCommand(() => CloseAction?.Invoke())).Value;
|
||||
public RelayCommand CloseCmd => new Lazy<RelayCommand>(() => new RelayCommand(() => CloseAction?.Invoke(""))).Value;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
using GalaSoft.MvvmLight;
|
||||
#if netle40
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
@@ -11,6 +12,7 @@ using HandyControl.Tools.Extension;
|
||||
using HandyControlDemo.UserControl;
|
||||
using HandyControlDemo.UserControl.Basic;
|
||||
using HandyControlDemo.ViewModel.Basic;
|
||||
using HandyControlDemo.Window;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
{
|
||||
@@ -57,5 +59,14 @@ namespace HandyControlDemo.ViewModel
|
||||
.GetResultAsync<string>();
|
||||
}
|
||||
#endif
|
||||
|
||||
public RelayCommand NewWindowCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => new DialogDemoWindow
|
||||
{
|
||||
Owner = Application.Current.MainWindow
|
||||
}.Show())).Value;
|
||||
|
||||
public RelayCommand<string> ShowWithTokenCmd => new Lazy<RelayCommand<string>>(() =>
|
||||
new RelayCommand<string>(token => Dialog.Show(new TextDialog(), token))).Value;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Windows;
|
||||
#if netle40
|
||||
using GalaSoft.MvvmLight.Command;
|
||||
#else
|
||||
@@ -65,6 +66,9 @@ namespace HandyControlDemo.ViewModel
|
||||
new RelayCommand(() => Growl.Clear())).Value;
|
||||
|
||||
public RelayCommand NewWindowCmd => new Lazy<RelayCommand>(() =>
|
||||
new RelayCommand(() => new GrowlDemoWindow().Show())).Value;
|
||||
new RelayCommand(() => new GrowlDemoWindow
|
||||
{
|
||||
Owner = Application.Current.MainWindow
|
||||
}.Show())).Value;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user