0
我想要在xaml中的這兩個控件之間建立DataBind,我該怎麼做?兩個控件之間的DataBind
<MenuItem Header="_Log" IsCheckable="True"/>
<TextBox Name="_commandsRichTextBox" ,Visibility="Collapsed"/>
而且我寫了一個轉換器:
class BoolToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (targetType != typeof(Visibility))
throw new InvalidOperationException("The target must be a Visibility");
return (bool)value ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
,我現在必須連接一切的問題。
感謝您的幫助。