feat: initialize and setup demo.
This commit is contained in:
55
demo/Ursa.Demo/ViewModels/EnumSelectorDemoViewModel.cs
Normal file
55
demo/Ursa.Demo/ViewModels/EnumSelectorDemoViewModel.cs
Normal file
@@ -0,0 +1,55 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using Avalonia.Animation;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Data;
|
||||
using Avalonia.Input;
|
||||
using Avalonia.Interactivity;
|
||||
using Avalonia.Layout;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace Ursa.Demo.ViewModels;
|
||||
|
||||
public class EnumSelectorDemoViewModel: ObservableObject
|
||||
{
|
||||
public ObservableCollection<Type?> Types { get; set; }
|
||||
|
||||
private Type? _selectedType;
|
||||
public Type? SelectedType
|
||||
{
|
||||
get => _selectedType;
|
||||
set
|
||||
{
|
||||
SetProperty(ref _selectedType, value);
|
||||
Value = null;
|
||||
}
|
||||
}
|
||||
|
||||
private object? _value;
|
||||
public object? Value
|
||||
{
|
||||
get => _value;
|
||||
set => SetProperty(ref _value, value);
|
||||
}
|
||||
|
||||
public EnumSelectorDemoViewModel()
|
||||
{
|
||||
Types = new ObservableCollection<Type?>()
|
||||
{
|
||||
typeof(HorizontalAlignment),
|
||||
typeof(VerticalAlignment),
|
||||
typeof(Orientation),
|
||||
typeof(Dock),
|
||||
typeof(GridResizeDirection),
|
||||
typeof(DayOfWeek),
|
||||
typeof(FillMode),
|
||||
typeof(IterationType),
|
||||
typeof(BindingMode),
|
||||
typeof(BindingPriority),
|
||||
typeof(StandardCursorType),
|
||||
typeof(Key),
|
||||
typeof(KeyModifiers),
|
||||
typeof(RoutingStrategies),
|
||||
};
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user