delete lazy code in viewmodels

This commit is contained in:
NaBian committed 2021-06-21 21:49:43 +08:00
1 parent 066cedeb73
commit 700f54ab2b
23 files changed
+141 -214

No files matched your search

@@ -1,5 +1,4 @@
using System;
using System.Windows;
using System.Windows;
using GalaSoft.MvvmLight.Command;
using HandyControl.Controls;
using HandyControl.Data;
@@ -12,16 +11,14 @@ namespace HandyControlDemo.ViewModel
{
public TabControlDemoViewModel(DataService dataService) => DataList = dataService.GetTabControlDemoDataList();
public RelayCommand<CancelRoutedEventArgs> ClosingCmd => new Lazy<RelayCommand<CancelRoutedEventArgs>>(() =>
new RelayCommand<CancelRoutedEventArgs>(Closing)).Value;
public RelayCommand<CancelRoutedEventArgs> ClosingCmd => new(Closing);
private void Closing(CancelRoutedEventArgs args)
{
Growl.Info($"{(args.OriginalSource as TabItem)?.Header} Closing");
}
public RelayCommand<RoutedEventArgs> ClosedCmd => new Lazy<RelayCommand<RoutedEventArgs>>(() =>
new RelayCommand<RoutedEventArgs>(Closed)).Value;
public RelayCommand<RoutedEventArgs> ClosedCmd => new(Closed);
private void Closed(RoutedEventArgs args)
{