【发布时间】:2016-02-14 10:09:44
【问题描述】:
我是 WPF 的新手,我想实现 IMultiValueConverter
On MainWindow.xaml.cs:
public class CanSelectNextPage2 : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (values[0] is bool && values[1] is bool && values[2] is string && values[3] is string && values[4] is string)
if (((bool)values[0] || (bool)values[1]) &&
(values[2] != null) && (values[3] != null) && (values[4] != null)
(values[2].ToString().Length > 1) &&
(values[3].ToString().Length > 1) &&
(values[4].ToString().Length > 1))
{
return true;
}
return false;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException();
}
}
我遇到了语法错误:
(values[4] != null)
错误是:需要方法名称
有人可以帮忙吗?
【问题讨论】:
标签: wpf data-binding multibinding