【发布时间】:2018-11-30 19:48:49
【问题描述】:
我有一个 ContentDialog,它链接它的
<ContentDialog
x:Class="ParadigmaN.Apps.Common.Controls.EditPersonContentDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:ParadigmaN.Apps.Common.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
x:Uid="EditorPersonas"
Title=""
PrimaryButtonText="Aceptar"
SecondaryButtonText="Cancelar"
PrimaryButtonClick="ContentDialog_PrimaryButtonClick"
SecondaryButtonClick="ContentDialog_SecondaryButtonClick"
PrimaryButtonCommand="{Binding ElementName=CtrPerson,Path=DataContext.GuardarCommand}">
<Grid>
<local:PersonControl x:Name="CtrPerson"/>
</Grid>
</ContentDialog>
但即使我的 CanExecuteCommand 返回 false,PrimaryButton 仍保持启用状态。
如何从 ContentDialog 控制 PrimaryButton 的启用状态?
【问题讨论】:
-
令人严重不安的是,该按钮上的此命令与其他命令不同。我认为这是一个错误并想报告它,但找不到在哪里这样做。