46 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			46 lines
		
	
	
		
			1.1 KiB
		
	
	
	
		
			C#
		
	
	
	
| 
								 | 
							
								using Prism.Commands;
							 | 
						|||
| 
								 | 
							
								using Prism.Services.Dialogs;
							 | 
						|||
| 
								 | 
							
								using System;
							 | 
						|||
| 
								 | 
							
								using System.Collections.Generic;
							 | 
						|||
| 
								 | 
							
								using System.Linq;
							 | 
						|||
| 
								 | 
							
								using System.Text;
							 | 
						|||
| 
								 | 
							
								using System.Threading.Tasks;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								namespace DM_Weight.ViewModels
							 | 
						|||
| 
								 | 
							
								{
							 | 
						|||
| 
								 | 
							
								    internal class DelUserDialogViewModel : IDialogAware
							 | 
						|||
| 
								 | 
							
								    {
							 | 
						|||
| 
								 | 
							
								        public string Title => "删除用户";
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public event Action<IDialogResult> RequestClose;
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public bool CanCloseDialog()
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            return true;
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public void OnDialogClosed()
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								
							 | 
						|||
| 
								 | 
							
								        public void OnDialogOpened(IDialogParameters parameters)
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        public DelegateCommand SaveDelUserCommand
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get => new DelegateCommand(() =>
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                RequestClose?.Invoke(new DialogResult(ButtonResult.OK));
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								        public DelegateCommand CancelCommand
							 | 
						|||
| 
								 | 
							
								        {
							 | 
						|||
| 
								 | 
							
								            get => new DelegateCommand(() =>
							 | 
						|||
| 
								 | 
							
								            {
							 | 
						|||
| 
								 | 
							
								                // 关闭当前窗口
							 | 
						|||
| 
								 | 
							
								                RequestClose?.Invoke(new DialogResult(ButtonResult.Cancel));
							 | 
						|||
| 
								 | 
							
								            });
							 | 
						|||
| 
								 | 
							
								        }
							 | 
						|||
| 
								 | 
							
								    }
							 | 
						|||
| 
								 | 
							
								}
							 |