fix: Fix DatePicker initialization issue.

This commit is contained in:
rabbitism
2024-08-06 14:22:11 +08:00
parent 3c8b7acad5
commit 18488ce056
4 changed files with 85 additions and 13 deletions

View File

@@ -1,6 +1,28 @@
namespace Ursa.Demo.ViewModels;
using System;
using System.ComponentModel;
using CommunityToolkit.Mvvm.ComponentModel;
public class DatePickerDemoViewModel
namespace Ursa.Demo.ViewModels;
public partial class DatePickerDemoViewModel: ObservableObject
{
[ObservableProperty] private DateTime? _selectedDate;
[ObservableProperty] private DateTime? _startDate;
[ObservableProperty] private DateTime? _endDate;
public DatePickerDemoViewModel()
{
SelectedDate = DateTime.Today;
StartDate = DateTime.Today;
EndDate = DateTime.Today.AddDays(7);
}
protected override void OnPropertyChanged(PropertyChangedEventArgs e)
{
base.OnPropertyChanged(e);
if (e.PropertyName == nameof(SelectedDate))
{
}
}
}