fix: fix button clear issue.
This commit is contained in:
@@ -19,6 +19,7 @@
|
|||||||
PanelFormat="hh mm tt" />
|
PanelFormat="hh mm tt" />
|
||||||
<u:TimePicker
|
<u:TimePicker
|
||||||
Width="300"
|
Width="300"
|
||||||
|
Classes="ClearButton"
|
||||||
DisplayFormat="HH 时 mm 分 ss 秒"
|
DisplayFormat="HH 时 mm 分 ss 秒"
|
||||||
PanelFormat="HH mm ss tt"
|
PanelFormat="HH mm ss tt"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
|
|||||||
@@ -123,11 +123,10 @@
|
|||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="{TemplateBinding BorderThickness}"
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
CornerRadius="{TemplateBinding CornerRadius}" />
|
CornerRadius="{TemplateBinding CornerRadius}" />
|
||||||
<Grid ColumnDefinitions="*, Auto, Auto">
|
<Grid ColumnDefinitions="*, Auto">
|
||||||
<TextBox
|
<TextBox
|
||||||
Name="{x:Static u:TimePicker.PART_TextBox}"
|
Name="{x:Static u:TimePicker.PART_TextBox}"
|
||||||
Grid.Column="0"
|
Grid.Column="0"
|
||||||
Grid.ColumnSpan="2"
|
|
||||||
HorizontalAlignment="Stretch"
|
HorizontalAlignment="Stretch"
|
||||||
VerticalAlignment="Stretch"
|
VerticalAlignment="Stretch"
|
||||||
Background="Transparent"
|
Background="Transparent"
|
||||||
@@ -172,7 +171,7 @@
|
|||||||
Theme="{DynamicResource InnerIconButton}" />
|
Theme="{DynamicResource InnerIconButton}" />
|
||||||
<Button
|
<Button
|
||||||
Name="{x:Static u:TimePicker.PART_Button}"
|
Name="{x:Static u:TimePicker.PART_Button}"
|
||||||
Grid.Column="2"
|
Grid.Column="1"
|
||||||
Padding="0,0,8,0"
|
Padding="0,0,8,0"
|
||||||
Content="{DynamicResource TimePickerIconGlyph}"
|
Content="{DynamicResource TimePickerIconGlyph}"
|
||||||
Focusable="False"
|
Focusable="False"
|
||||||
@@ -234,6 +233,9 @@
|
|||||||
<Style Selector="^:pointerover /template/ Button#ClearButton">
|
<Style Selector="^:pointerover /template/ Button#ClearButton">
|
||||||
<Setter Property="IsVisible" Value="{Binding $parent[u:TimePicker].SelectedTime, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
<Setter Property="IsVisible" Value="{Binding $parent[u:TimePicker].SelectedTime, Converter={x:Static ObjectConverters.IsNotNull}}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style Selector="^:pointerover /template/ Button#PART_Button">
|
||||||
|
<Setter Property="IsVisible" Value="{Binding $parent[u:TimePicker].SelectedTime, Converter={x:Static ObjectConverters.IsNull}}"/>
|
||||||
|
</Style>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
<Style Selector="^:pointerover">
|
<Style Selector="^:pointerover">
|
||||||
|
|||||||
@@ -118,7 +118,7 @@ public class TimePicker : TemplatedControl, IClearControl, IInnerContentControl,
|
|||||||
|
|
||||||
public void Clear()
|
public void Clear()
|
||||||
{
|
{
|
||||||
SetCurrentValue(SelectedTimeProperty, null);
|
_presenter?.SetValue(TimePickerPresenter.TimeProperty, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public object? InnerLeftContent
|
public object? InnerLeftContent
|
||||||
|
|||||||
Reference in New Issue
Block a user