From b486f16f4a47bdbd04571b3e97c466e950f82529 Mon Sep 17 00:00:00 2001 From: Stepan Pilipenko Date: Tue, 11 Nov 2025 21:40:38 +0300 Subject: [PATCH] double tap --- FileSystemItem.cs | 27 +++++++++- MainPage.xaml | 85 ++++++++++++++---------------- MainPage.xaml.cs | 129 +++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 185 insertions(+), 56 deletions(-) diff --git a/FileSystemItem.cs b/FileSystemItem.cs index e62c415..047e305 100644 --- a/FileSystemItem.cs +++ b/FileSystemItem.cs @@ -1,10 +1,33 @@ -namespace CommanderApp +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace CommanderApp { - public class FileSystemItem + 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)); + } } } diff --git a/MainPage.xaml b/MainPage.xaml index 93a7e11..517dfbf 100644 --- a/MainPage.xaml +++ b/MainPage.xaml @@ -4,43 +4,46 @@ x:Class="CommanderApp.MainPage" Title="MAUI Commander"> - - + + +