fix:should be PathPickerForListView in demo

add:Maybe we can add a command demo here to show how to trigger the bound command.
change:I think these two themes should be merged, and the "AcceptReturn" should just be controlled by "AllowMultiple"
add:One more thing, we should add a property to control what to do when user cancelled a selection. Sometimes I just want to keep the original selection.
This commit is contained in:
望尘空忧
2025-01-13 19:08:55 +08:00
parent c6bbcf7226
commit d3aa632d1d
4 changed files with 54 additions and 39 deletions

View File

@@ -1,5 +1,6 @@
using System.Collections.Generic;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
namespace Ursa.Demo.ViewModels;
@@ -7,4 +8,11 @@ public partial class PathPickerDemoViewModel : ViewModelBase
{
[ObservableProperty] private string? _path;
[ObservableProperty] private IReadOnlyList<string>? _paths;
[ObservableProperty] private int _commandTriggerCount = 0;
[RelayCommand]
private void Selected(IReadOnlyList<string> paths)
{
CommandTriggerCount++;
}
}