我是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)错误是:预期的方法名称
有人能帮忙吗?
发布于 2016-02-14 10:18:15
您在&&之后缺少了(values[4] != null)操作符。
https://stackoverflow.com/questions/35390583
复制相似问题