using System.Collections.Generic; using System.Collections.ObjectModel; using System.IO; namespace winui_learning_3.Models; public class FolderContentDto { public required string AbsolutePath { get; set; } public ObservableCollection Children { get; set; } = []; public List Files { get; set; } = []; public string Name { get { var name = Path.GetFileName(AbsolutePath.TrimEnd(Path.DirectorySeparatorChar)); return string.IsNullOrEmpty(name) ? AbsolutePath : name; // "C:\" has no file name } } }