您可以将IsCheckedDependency Property 绑定到布尔值.在该绑定属性设置器上,您可以操作您想要的内容(如果将其设置为true或false,则可以单独操作).这与预期一样有效.
在你看来:
<Grid>
<CheckBox ... IsChecked="{Binding ShowPending}"/>
</Grid>
Run Code Online (Sandbox Code Playgroud)
在您的DataContext ViewModel或CodeBehind上.
private bool showPending = false;
public bool ShowPending
{
get { return this.showPending; }
set
{
//Here you mimic your Toggled event calling what you want!
this.showPending = value;
}
}
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
10103 次 |
| 最近记录: |