You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1012 B
C#
34 lines
1012 B
C#
using System.ComponentModel;
|
|
using System.Runtime.CompilerServices;
|
|
|
|
namespace CommanderApp
|
|
{
|
|
public class FileSystemItem : INotifyPropertyChanged
|
|
{
|
|
public string Name { get; set; }
|
|
public string FullName { get; set; }
|
|
public bool IsDirectory { get; set; }
|
|
public string Icon => IsDirectory ? "folder.png" : "file.png";
|
|
|
|
private bool _isSelected;
|
|
public bool IsSelected
|
|
{
|
|
get => _isSelected;
|
|
set
|
|
{
|
|
_isSelected = value;
|
|
OnPropertyChanged();
|
|
}
|
|
}
|
|
|
|
// Событие из INotifyPropertyChanged
|
|
public event PropertyChangedEventHandler? PropertyChanged;
|
|
|
|
// Защищённый метод для вызова события
|
|
protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
|
|
{
|
|
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
|
}
|
|
}
|
|
}
|