Files
BeWoPlaner/BeWo/ViewModel/View/DialogViewModel.cs

41 lines
861 B
C#

using DevExpress.Mvvm;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Input;
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;
}
}
}