1234567891011121314151617181920212223242526 |
- using Avalonia.Layout;
- using CommunityToolkit.Mvvm.ComponentModel;
- using CommunityToolkit.Mvvm.Input;
- using System.Collections.ObjectModel;
- namespace InABox.Avalonia.Dialogs;
- public partial class OptionDialogViewModel : BasePopupViewModel<string>, IAlignedPopup
- {
- [ObservableProperty]
- private string _title = "Select Option";
- [ObservableProperty]
- private ObservableCollection<string> _options = new();
- public HorizontalAlignment HorizontalAlignment => HorizontalAlignment.Stretch;
- public VerticalAlignment VerticalAlignment => VerticalAlignment.Center;
- [RelayCommand]
- private void Cancel() => Close(null);
- [RelayCommand]
- private void Select(string option) => Close(option);
-
- }
|