/
githubmirror
/
Files
Обзор
Документация
Войти
/
githubmirror
/
Files
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
src/Files.App/Data/Items/WslDistroItem.cs
70 строк
1 KB
yair100
Feature: Added Tree View sidebar (#18537)
14 июн 2026, 17:35
Не верифицирован
14 июн 2026, 17:35
d11c28b
Код
Авторство
О чём код?
// Copyright (c) Files Community // Licensed under the MIT License. using Microsoft.UI.Xaml.Controls; namespace Files.App.Data.Items { public sealed partial class WslDistroItem : ObservableObject, INavigationControlItem { public string Text { get; set; } private string path; public string Path { get => path; set { path = value; ToolTip = Path.Contains('?', StringComparison.Ordinal) ? Text : Path; } } public NavigationControlItemType ItemType => NavigationControlItemType.LinuxDistro; private Uri icon; public Uri Icon { get => icon; set { SetProperty(ref icon, value, nameof(Icon)); OnPropertyChanged(nameof(IconElement)); } } public SectionType Section { get; set; } public ContextMenuOptions MenuOptions { get; set; } public object? Children => null; private object toolTip = ""; public object ToolTip { get => toolTip; set { SetProperty(ref toolTip, value); } } public bool IsExpanded { get => false; set { } } public IconElement? IconElement { get { var source = new BitmapIconSource() { UriSource = icon, ShowAsMonochrome = false, }; return source.CreateIconElement(); } } public int CompareTo(INavigationControlItem? other) => Text.CompareTo(other.Text); } }