32 lines
791 B
C#
32 lines
791 B
C#
using System;
|
|
using Pf2e.Database.Model.Base;
|
|
|
|
namespace Pf2e.WPF.EntityViewer.Stores;
|
|
|
|
/// <summary>
|
|
/// Хранилище выбранной сущности.
|
|
/// </summary>
|
|
public class SelectedEntityStore
|
|
{
|
|
/// <exclude />
|
|
private Entity? _selectedEntity;
|
|
|
|
/// <summary>
|
|
/// Сущность, выбранная в интерфейсе.
|
|
/// </summary>
|
|
public Entity? SelectedEntity
|
|
{
|
|
get => _selectedEntity;
|
|
set
|
|
{
|
|
_selectedEntity = value;
|
|
SelectedEntityChanged?.Invoke(SelectedEntity);
|
|
}
|
|
}
|
|
|
|
/// <summary>
|
|
/// Событие, вызываемое при изменении выбранной сущности.
|
|
/// </summary>
|
|
public event Action<Entity?>? SelectedEntityChanged;
|
|
}
|