63 lines
1.4 KiB
C#
63 lines
1.4 KiB
C#
using System.Collections.ObjectModel;
|
|
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace EmbyToolbox.ViewModels;
|
|
|
|
public enum RenameTreeSide
|
|
{
|
|
Current,
|
|
Preview
|
|
}
|
|
|
|
public sealed class RenameTreeNodeViewModel : INotifyPropertyChanged
|
|
{
|
|
private bool _isExpanded;
|
|
private bool _isSelected;
|
|
|
|
public required string Name { get; init; }
|
|
public required string Kind { get; init; }
|
|
public required string IconGlyph { get; init; }
|
|
public required string NodeKey { get; init; }
|
|
public required RenameTreeSide Side { get; init; }
|
|
|
|
public ObservableCollection<RenameTreeNodeViewModel> Children { get; } = new();
|
|
|
|
public bool IsExpanded
|
|
{
|
|
get => _isExpanded;
|
|
set
|
|
{
|
|
if (_isExpanded == value)
|
|
{
|
|
return;
|
|
}
|
|
|
|
_isExpanded = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
public bool IsSelected
|
|
{
|
|
get => _isSelected;
|
|
set
|
|
{
|
|
if (_isSelected == value)
|
|
{
|
|
return;
|
|
}
|
|
|
|
_isSelected = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
private void OnPropertyChanged([CallerMemberName] string? propertyName = null)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
}
|