style: 修改部分代码样式

This commit is contained in:
姚彪
2024-01-10 23:24:44 +08:00
parent 30880c8b8f
commit 4bc340cead
20 changed files with 399 additions and 462 deletions

View File

@@ -12,20 +12,20 @@ public class BaseDialogViewModel : BindableBase, IDialogAware
{
#region
private string title;
private string _title;
public string Title
{
get => title;
set => SetProperty(ref title, value);
get => _title;
set => SetProperty(ref _title, value);
}
private VectorImage closeIcon;
private VectorImage _closeIcon;
public VectorImage CloseIcon
{
get => closeIcon;
set => SetProperty(ref closeIcon, value);
get => _closeIcon;
set => SetProperty(ref _closeIcon, value);
}
#endregion
@@ -49,10 +49,9 @@ public class BaseDialogViewModel : BindableBase, IDialogAware
#region
// 鼠标进入关闭按钮事件
private DelegateCommand closeEnterCommand;
private DelegateCommand? _closeEnterCommand;
public DelegateCommand CloseEnterCommand =>
closeEnterCommand ?? (closeEnterCommand = new DelegateCommand(ExecuteCloseEnterCommand));
public DelegateCommand CloseEnterCommand => _closeEnterCommand ??= new DelegateCommand(ExecuteCloseEnterCommand);
/// <summary>
/// 鼠标进入关闭按钮事件
@@ -63,10 +62,9 @@ public class BaseDialogViewModel : BindableBase, IDialogAware
}
// 鼠标离开关闭按钮事件
private DelegateCommand closeLeaveCommand;
private DelegateCommand? _closeLeaveCommand;
public DelegateCommand CloseLeaveCommand =>
closeLeaveCommand ?? (closeLeaveCommand = new DelegateCommand(ExecuteCloseLeaveCommand));
public DelegateCommand CloseLeaveCommand => _closeLeaveCommand ??= new DelegateCommand(ExecuteCloseLeaveCommand);
/// <summary>
/// 鼠标离开关闭按钮事件
@@ -77,16 +75,15 @@ public class BaseDialogViewModel : BindableBase, IDialogAware
}
// 关闭窗口事件
private DelegateCommand closeCommand;
public DelegateCommand CloseCommand => closeCommand ?? (closeCommand = new DelegateCommand(ExecuteCloseCommand));
private DelegateCommand? _closeCommand;
public DelegateCommand CloseCommand => _closeCommand ??= new DelegateCommand(ExecuteCloseCommand);
/// <summary>
/// 关闭窗口事件
/// </summary>
private void ExecuteCloseCommand()
{
ButtonResult result = ButtonResult.Cancel;
RaiseRequestClose(new DialogResult(result));
RaiseRequestClose(new DialogResult(ButtonResult.Cancel));
}
#endregion