Null-conditional operator support and null
To calculate the visibilty of a control i'm using CalcBinding something like 'A?.B?.C > 0'.
I get a binding error saying "Value produced by BindingExpression is not valid for target property.; Value='
I also tried 'A != null and A.B != null and A.B.C > 0' but i can't get it to work.
So the question: is Null-conditional operator supported? Is it null supported in comparisons?
Thanks
P.S. - A naive converter works just fine
public class CarouselVisibility : BaseConverter, IValueConverter
{
public object Convert( object value, Type targetType, object parameter, CultureInfo culture )
{
var vm = value as ViewModel;
return vm?.A?.B?.C?.Count > 0 ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack( object value, Type targetType, object parameter, CultureInfo culture )
{
throw new NotImplementedException();
}
}
Try
'A != {x:Null} and A.B != {x:Null} and A.B.C > 0'
This is some 3 years late but thanks anyway.
On 13 Dec 2020, at 22:18, Keytrap [email protected] wrote:
Try
'A != {x:Null} and A.B != {x:Null} and A.B.C > 0'
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
I discovered CalcBindings yesterday. Hope it'll help some futur readers