Optimized growl

This commit is contained in:
NaBian committed 2019-03-31 21:42:05 +08:00
1 parent 513e57f013
commit f7ca63a1ca
10 files changed
+155 -77

No files matched your search

@@ -8,11 +8,23 @@ namespace HandyControlDemo.ViewModel
{
public class GrowlDemoViewModel
{
private readonly string _token;
public GrowlDemoViewModel()
{
}
public GrowlDemoViewModel(string token)
{
_token = token;
}
public RelayCommand InfoCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(() => Growl.Info(Properties.Langs.Lang.GrowlInfo))).Value;
new RelayCommand(() => Growl.Info(Properties.Langs.Lang.GrowlInfo, _token))).Value;
public RelayCommand SuccessCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(() => Growl.Success(Properties.Langs.Lang.GrowlSuccess))).Value;
new RelayCommand(() => Growl.Success(Properties.Langs.Lang.GrowlSuccess, _token))).Value;
public RelayCommand WarningCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(() => Growl.Warning(new GrowlInfo
@@ -23,24 +35,26 @@ namespace HandyControlDemo.ViewModel
{
Growl.Info(isConfirmed.ToString());
return true;
}
},
Token = _token
}))).Value;
public RelayCommand ErrorCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(() => Growl.Error(Properties.Langs.Lang.GrowlError))).Value;
new RelayCommand(() => Growl.Error(Properties.Langs.Lang.GrowlError, _token))).Value;
public RelayCommand AskCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(() => Growl.Ask(Properties.Langs.Lang.GrowlAsk, isConfirmed =>
{
Growl.Info(isConfirmed.ToString());
return true;
}))).Value;
}, _token))).Value;
public RelayCommand FatalCmd => new Lazy<RelayCommand>(() =>
new RelayCommand(() => Growl.Fatal(new GrowlInfo
{
Message = Properties.Langs.Lang.GrowlFatal,
ShowDateTime = false
ShowDateTime = false,
Token = _token
}))).Value;
public RelayCommand ClearCmd => new Lazy<RelayCommand>(() =>