49 lines
1023 B
C#
49 lines
1023 B
C#
using DevExpress.Mvvm;
|
|
using DevExpress.Mvvm.POCO;
|
|
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 AcceptCancelDialogViewModel : DialogViewModel
|
|
{
|
|
public event EventHandler Accept_Button_Clicked;
|
|
public event EventHandler Cancel_Button_Clicked;
|
|
|
|
public AcceptCancelDialogViewModel() : base()
|
|
{
|
|
AcceptCommand = new DelegateCommand(Accept, canAccept, false);
|
|
CancelCommand = new DelegateCommand(Cancel, canCancel, false);
|
|
}
|
|
|
|
public DelegateCommand AcceptCommand { get; set; }
|
|
public DelegateCommand CancelCommand { get; set; }
|
|
|
|
public void Accept()
|
|
{
|
|
Accept_Button_Clicked?.Invoke(this, EventArgs.Empty);
|
|
Close();
|
|
}
|
|
|
|
public void Cancel()
|
|
{
|
|
Cancel_Button_Clicked?.Invoke(this, EventArgs.Empty);
|
|
Close();
|
|
}
|
|
|
|
protected virtual bool canAccept()
|
|
{
|
|
return true;
|
|
}
|
|
|
|
protected virtual bool canCancel()
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
}
|