Feat: add a new control PathPicker, add PathPickerDemo

This commit is contained in:
望尘空忧
2025-01-10 11:50:11 +08:00
committed by wckfx
parent dac9656d17
commit 3d08aa37ed
11 changed files with 470 additions and 18 deletions

View File

@@ -4,6 +4,7 @@ using Avalonia;
using Avalonia.Styling;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Messaging;
using Ursa.Controls;
using Ursa.Themes.Semi;
namespace Ursa.Demo.ViewModels;
@@ -79,6 +80,7 @@ public partial class MainViewViewModel : ViewModelBase
MenuKeys.MenuKeyTreeComboBox => new TreeComboBoxDemoViewModel(),
MenuKeys.MenuKeyTwoTonePathIcon => new TwoTonePathIconDemoViewModel(),
MenuKeys.AspectRatioLayout => new AspectRatioLayoutDemoViewModel(),
MenuKeys.PathPicker => new PathPickerDemoViewModel(),
_ => throw new ArgumentOutOfRangeException(nameof(s), s, null)
};
}

View File

@@ -59,7 +59,8 @@ public class MenuViewModel : ViewModelBase
new() { MenuHeader = "ToolBar", Key = MenuKeys.MenuKeyToolBar },
new() { MenuHeader = "TreeComboBox", Key = MenuKeys.MenuKeyTreeComboBox },
new() { MenuHeader = "TwoTonePathIcon", Key = MenuKeys.MenuKeyTwoTonePathIcon },
new() { MenuHeader = "AspectRatioLayout", Key = MenuKeys.AspectRatioLayout ,Status = "WIP"},
new() { MenuHeader = "AspectRatioLayout", Key = MenuKeys.AspectRatioLayout, Status = "New" },
new() { MenuHeader = "PathPicker", Key = MenuKeys.PathPicker, Status = "WIP" },
};
}
}
@@ -115,4 +116,5 @@ public static class MenuKeys
public const string MenuKeyTreeComboBox = "TreeComboBox";
public const string MenuKeyTwoTonePathIcon = "TwoTonePathIcon";
public const string AspectRatioLayout = "AspectRatioLayout";
public const string PathPicker = "PathPicker";
}

View File

@@ -0,0 +1,10 @@
using System.Collections.Generic;
using CommunityToolkit.Mvvm.ComponentModel;
namespace Ursa.Demo.ViewModels;
public partial class PathPickerDemoViewModel : ViewModelBase
{
[ObservableProperty] private string? _path;
[ObservableProperty] private IReadOnlyList<string>? _paths;
}