我用CheckBox,Lable做了Binding,实现了BoolToVisibleOrHidden类,意思是什么时候checkBox1.IsChecked
应该显示Lable,我要实现的是checkbox选中的EventHandler,我想用MessageBox实现。如果Messabox.Yes
那时只应显示标签,
<CheckBox Name="_checkBoxExpertMode" IsChecked="{Binding Path=DisplayChecked, Mode=TwoWay}"
<Lable Name="_lableDisplay" Visibility="{Binding Path=DisplayChecked, Mode=OneWay, NotifyOnTargetUpdated=True, Converter={StaticResource BoolToVisConverter}}"
/>
System.Windows.Forms.DialogResult dialogResult = System.Windows.Forms.MessageBox.Show("Sure", "Some Title", System.Windows.Forms.MessageBoxButtons.YesNo);
if (dialogResult == System.Windows.Forms.DialogResult.Yes)
{
_checkBoxExpertMode.IsChecked = true;
}
else if (dialogResult == System.Windows.Forms.DialogResult.No)
{
_checkBoxExpertMode.IsChecked = false;
}
但是标签在消息框弹出之前显示。
帮帮我,提前谢谢