feat: add async command support.

This commit is contained in:
Dong Bin
2025-04-18 02:37:27 +08:00
parent e9a94798e3
commit 5da5e0626a
3 changed files with 57 additions and 13 deletions

View File

@@ -7,14 +7,24 @@
<ControlTemplate TargetType="u:PopConfirm">
<Panel>
<ContentPresenter Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}"/>
<Popup IsOpen="True">
<Popup IsOpen="True"
Name="{x:Static u:PopConfirm.PART_Popup}"
Placement="Bottom" >
<Border Theme="{DynamicResource CardBorder}">
<StackPanel>
<ContentPresenter Content="{TemplateBinding PopupHeader}" ContentTemplate="{TemplateBinding PopupHeaderTemplate}"/>
<ContentPresenter Content="{TemplateBinding PopupContent}" ContentTemplate="{TemplateBinding PopupContentTemplate}"/>
<StackPanel Orientation="Horizontal">
<Button Content="Confirm" Command="{TemplateBinding ConfirmCommand}" CommandParameter="{TemplateBinding ConfirmCommandParameter}"/>
<Button Content="Cancel" Command="{TemplateBinding CancelCommand}" CommandParameter="{TemplateBinding CancelCommandParameter}"/>
<Button
Name="{x:Static u:PopConfirm.PART_ConfirmButton}"
Content="Confirm"
Command="{TemplateBinding ConfirmCommand}"
CommandParameter="{TemplateBinding ConfirmCommandParameter}"/>
<Button
Name="{x:Static u:PopConfirm.PART_CancelButton}"
Content="Cancel"
Command="{TemplateBinding CancelCommand}"
CommandParameter="{TemplateBinding CancelCommandParameter}"/>
</StackPanel>
</StackPanel>
</Border>