feat: remove EnumSelector in demo.
This commit is contained in:
@@ -1,12 +1,33 @@
|
||||
using System;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using Avalonia.Layout;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using Ursa.Common;
|
||||
|
||||
namespace Ursa.Demo.ViewModels;
|
||||
|
||||
public partial class FormDemoViewModel: ObservableObject
|
||||
public partial class FormDemoViewModel : ObservableObject
|
||||
{
|
||||
[ObservableProperty] private DataModel _model;
|
||||
[ObservableProperty] private Position _selectedPosition = Position.Top;
|
||||
[ObservableProperty] private HorizontalAlignment _selectedHorizontalAlignment = HorizontalAlignment.Left;
|
||||
|
||||
public ObservableCollection<Position> Positions =>
|
||||
[
|
||||
Position.Left,
|
||||
Position.Top,
|
||||
Position.Right,
|
||||
Position.Bottom,
|
||||
];
|
||||
|
||||
public ObservableCollection<HorizontalAlignment> HorizontalAlignments =>
|
||||
[
|
||||
HorizontalAlignment.Stretch,
|
||||
HorizontalAlignment.Left,
|
||||
HorizontalAlignment.Center,
|
||||
HorizontalAlignment.Right,
|
||||
];
|
||||
|
||||
public FormDemoViewModel()
|
||||
{
|
||||
@@ -21,28 +42,30 @@ public partial class DataModel : ObservableObject
|
||||
[MinLength(10)]
|
||||
public string Name
|
||||
{
|
||||
get=>_name;
|
||||
get => _name;
|
||||
set => SetProperty(ref _name, value);
|
||||
}
|
||||
|
||||
private double _number;
|
||||
|
||||
[Range(0.0, 10.0)]
|
||||
public double Number
|
||||
{
|
||||
get => _number;
|
||||
set => SetProperty(ref _number, value);
|
||||
}
|
||||
|
||||
|
||||
private string _email;
|
||||
|
||||
|
||||
[EmailAddress]
|
||||
public string Email
|
||||
{
|
||||
get=>_email;
|
||||
get => _email;
|
||||
set => SetProperty(ref _email, value);
|
||||
}
|
||||
|
||||
private DateTime _date;
|
||||
|
||||
public DateTime Date
|
||||
{
|
||||
get => _date;
|
||||
|
||||
Reference in New Issue
Block a user