fix: fix various timepicker sync issue.
This commit is contained in:
@@ -5,12 +5,16 @@
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
xmlns:viewModels="clr-namespace:Ursa.Demo.ViewModels"
|
||||
d:DesignHeight="450"
|
||||
d:DesignWidth="800"
|
||||
x:DataType="viewModels:TimePickerDemoViewModel"
|
||||
mc:Ignorable="d">
|
||||
<StackPanel HorizontalAlignment="Left">
|
||||
<ToggleSwitch Name="needConfirm" Content="Need Confirm" />
|
||||
<!--
|
||||
<TextBlock Text="{Binding #picker.SelectedTime}" />
|
||||
-->
|
||||
<TextBox
|
||||
Name="displayFormat"
|
||||
Width="300"
|
||||
@@ -21,6 +25,7 @@
|
||||
Width="300"
|
||||
InnerLeftContent="Panel Format"
|
||||
Text="tt HH mm ss" />
|
||||
<!--
|
||||
<u:TimePicker
|
||||
Name="picker"
|
||||
Width="200"
|
||||
@@ -42,5 +47,19 @@
|
||||
Width="300"
|
||||
DisplayFormat="{Binding #displayFormat.Text}"
|
||||
PanelFormat="{Binding #panelFormat.Text}" />
|
||||
-->
|
||||
<TextBlock Text="Binding"/>
|
||||
<u:TimePicker
|
||||
Width="300"
|
||||
HorizontalAlignment="Left"
|
||||
SelectedTime="{Binding Time}"
|
||||
DisplayFormat="{Binding #displayFormat.Text}"
|
||||
PanelFormat="{Binding #panelFormat.Text}" />
|
||||
<u:TimeRangePicker
|
||||
Width="300"
|
||||
StartTime="{Binding StartTime}"
|
||||
EndTime="{Binding EndTime}"
|
||||
DisplayFormat="{Binding #displayFormat.Text}"
|
||||
PanelFormat="{Binding #panelFormat.Text}" />
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,8 +1,18 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using System;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
|
||||
namespace Ursa.Demo.ViewModels;
|
||||
|
||||
public class TimePickerDemoViewModel: ObservableObject
|
||||
public partial class TimePickerDemoViewModel: ObservableObject
|
||||
{
|
||||
|
||||
[ObservableProperty] private TimeSpan? _time;
|
||||
[ObservableProperty] private TimeSpan? _startTime;
|
||||
[ObservableProperty] private TimeSpan? _endTime;
|
||||
|
||||
public TimePickerDemoViewModel()
|
||||
{
|
||||
Time = new TimeSpan(12, 20, 0);
|
||||
StartTime = new TimeSpan(8, 21, 0);
|
||||
EndTime = new TimeSpan(18, 22, 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user