fix: update TimePicker to correctly handle second selector panel type. (#856)

This commit is contained in:
Dong Bin
2026-01-19 14:10:46 +08:00
committed by GitHub
parent 0c978e1318
commit 975757dbb8
2 changed files with 2 additions and 2 deletions

View File

@@ -72,7 +72,7 @@
Name="{x:Static u:TimePickerPresenter.PART_SecondSelector}" Name="{x:Static u:TimePickerPresenter.PART_SecondSelector}"
MinWidth="64" MinWidth="64"
ItemHeight="32" ItemHeight="32"
PanelType="Minute" PanelType="Second"
ShouldLoop="True" /> ShouldLoop="True" />
</ScrollViewer> </ScrollViewer>
<Rectangle <Rectangle

View File

@@ -148,7 +148,7 @@ public class TimePickerPresenter : TemplatedControl
else if (part[0] == 's' && !panels.Contains(_secondScrollPanel)) else if (part[0] == 's' && !panels.Contains(_secondScrollPanel))
{ {
panels.Add(_secondScrollPanel); panels.Add(_secondScrollPanel);
_secondSelector?.SetValue(DateTimePickerPanel.ItemFormatProperty, part.Replace('s', 'm')); _secondSelector?.SetValue(DateTimePickerPanel.ItemFormatProperty, part);
} }
else if (part[0] == 't' && !panels.Contains(_ampmScrollPanel)) else if (part[0] == 't' && !panels.Contains(_ampmScrollPanel))
{ {