using DevExpress.Mvvm; using System; namespace BeWo.ViewModel.View { public class DialogViewModel : WindowViewModel { public event EventHandler Closing; public event EventHandler Closed; public DelegateCommand CloseCommand { get; set; } public DelegateCommand CloseFinalCommand { get; set; } protected DialogViewModel() : base() { CloseCommand = new DelegateCommand(Close, canClose, false); CloseFinalCommand = new DelegateCommand(CloseFinal, canClose, false); } protected virtual void Close() { Closing?.Invoke(this, EventArgs.Empty); } protected virtual void CloseFinal() { Closed?.Invoke(this, EventArgs.Empty); } protected virtual bool canClose() { return true; } } }