Files
Ursa.Avalonia/demo/Ursa.Demo/ViewModels/PathPickerDemoViewModel.cs
望尘空忧 d3aa632d1d 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.
2025-01-13 19:08:55 +08:00

18 lines
507 B
C#

using System.Collections.Generic;
using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
namespace Ursa.Demo.ViewModels;
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++;
}
}