Optimized growl
This commit is contained in:
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>(() =>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
using System;
|
||||
using System.Reflection.Emit;
|
||||
using System.Windows;
|
||||
using CommonServiceLocator;
|
||||
using GalaSoft.MvvmLight.Ioc;
|
||||
using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Service;
|
||||
|
||||
namespace HandyControlDemo.ViewModel
|
||||
@@ -15,7 +17,8 @@ namespace HandyControlDemo.ViewModel
|
||||
SimpleIoc.Default.Register<DataService>();
|
||||
|
||||
SimpleIoc.Default.Register<MainViewModel>();
|
||||
SimpleIoc.Default.Register<GrowlDemoViewModel>();
|
||||
SimpleIoc.Default.Register(() => new GrowlDemoViewModel(), "GrowlDemo");
|
||||
SimpleIoc.Default.Register(() => new GrowlDemoViewModel(MessageToken.GrowlDemoPanel), "GrowlDemoWithToken");
|
||||
SimpleIoc.Default.Register<ImageBrowserDemoViewModel>();
|
||||
SimpleIoc.Default.Register<ComboBoxDemoViewModel>();
|
||||
SimpleIoc.Default.Register<WindowDemoViewModel>();
|
||||
@@ -36,7 +39,9 @@ namespace HandyControlDemo.ViewModel
|
||||
|
||||
public MainViewModel Main => ServiceLocator.Current.GetInstance<MainViewModel>();
|
||||
|
||||
public GrowlDemoViewModel GrowlDemo => ServiceLocator.Current.GetInstance<GrowlDemoViewModel>();
|
||||
public GrowlDemoViewModel GrowlDemo => ServiceLocator.Current.GetInstance<GrowlDemoViewModel>("GrowlDemo");
|
||||
|
||||
public GrowlDemoViewModel GrowlDemoWithToken => ServiceLocator.Current.GetInstance<GrowlDemoViewModel>("GrowlDemoWithToken");
|
||||
|
||||
public ImageBrowserDemoViewModel ImageBrowserDemo => ServiceLocator.Current.GetInstance<ImageBrowserDemoViewModel>();
|
||||
|
||||
|
||||
Reference in new issue
Block a user