我已经编写了这两个转换器,但它们没有被调用......我是否需要在 minisetup.cs 文件中添加额外的代码才能让它们工作
public class BooleanNegationValueConverter : IMvxValueConverter
{
#region IMvxValueConverter implementation
public object Convert (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
return (!(Boolean)(value));
}
public object ConvertBack (object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
throw new NotImplementedException ();
}
#endregion
我以通常的方式使用它
set.Bind(toolbar.hidden).To(vm => vm.toolbarstate).WithConversion("BooleanNegation");
我正在使用 MvvmcrossCore