EPLAN_PROD_Plugin/Sinvo.EplanHpD.Plugin.WPFUI/View/Dialog/NotSavedWarningViewModel.cs

45 lines
1.2 KiB
C#
Raw Normal View History

using CommunityToolkit.Mvvm.Input;
using HandyControl.Tools.Extension;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
namespace Sinvo.EplanHpD.Plugin.WPFUI.View.Dialog
{
public class NotSavedWarningViewModel : INotifyPropertyChanged, IDialogResultable<bool>
{
public event PropertyChangedEventHandler PropertyChanged;
public void OnChange([CallerMemberName] string propName = null)
{
PropertyChanged?.Invoke(propName, new PropertyChangedEventArgs(propName));
}
private Dictionary<string, string> _notSavedLectotypeList = [];
public Dictionary<string, string> NotSavedLectotypeList
{
get => _notSavedLectotypeList;
set
{
_notSavedLectotypeList = value;
OnChange();
}
}
public bool Result { get ; set ; }
public Action CloseAction { get; set; }
internal void Close(bool result)
{
Result = result;
CloseAction?.Invoke();
}
}
}