private Node? _selectedItem;
private Node? _selectedItemUpdate;
private DateTime _dateUpdated;
private Node TreeRoot { get; }
public Node? SelectedItem
{
get => _selectedItemUpdate;
set
{
_selectedItemUpdate = value;
if ( value != null && ( value != _selectedItem
|| _dateUpdated != _selectedItem.Details.Timestamp ) )
{
_selectedItem = value;
SetAndRaise( ref _selectedItemUpdate, null );
SetAndRaise( ref _selectedItemUpdate, value );
_dateUpdated = value.Details.Timestamp;
}
}
}
public void SetAndRaise<T>( ref T field, T newValue, [CallerMemberName] string? name = null )
{
if ( !Equals( field, newValue ) )
{
field = newValue;
PropertyChanged?.Invoke( this, new PropertyChangedEventArgs( name ) );
}
}