首页 > 解决方案 > Cancelcommand 在 xamarin 表单中的 sfdatepicker 中不起作用

问题描述

我希望在单击 sfdatepicker 页脚的取消按钮时具有正常的取消功能,我试图通过绑定命令来实现它,但它不起作用。任何人都可以建议我任何解决方案吗?

标签: xamarinxamarin.formssyncfusion

解决方案


您可以使用如下代码:

 <datePicker:SfDatePicker.FooterView> 
     <Grid> 
          <Button Text="Ok" 
                  x:Name="footerViewButton" 
                  Clicked="footerViewButton_Clicked"/> 
     </Grid> 
  </datePicker:SfDatePicker.FooterView> 

以这种方式创建,然后在ViewModel中创建相应的方法来实现逻辑操作。


推荐阅读