I am working on Listview, one of Label inside Cell using Converter, I need to pass one property as converter parameter which is not part of itemsource but defined in viewmodel.
This is my code
<Label FontSize="10"
Text="Insufficient Funds"
IsVisible="{Binding balance, Converter={StaticResource IsInsufficientBalanceConverter}, Source={x:Reference Name=multiCardPage}, ConverterParameter={x:Reference BindingContext.Subtotal} }">
Getting this exception
Xamarin.Forms.Xaml.XamlParseException: 'Position 120:52. Can not find the object referenced by BindingContext.Subtotal'
What I want to do :
I have a value Subtotal (not part of itemsource). In itemsource, there is balance property, if balance is less than Subtotal, I want to display above Insufficient Funds Label otherwise this Label should be invisible. For this I want to pass Subtotal to Converter with balance so that I can get true or false value.
How can I make it work ?
Edit 1: I want view and converter to listen the changes in subtotal value and update the UI accordingly so that Insufficient balance label can visible/invisible as per balance in listview. I have tried multibindings but that is not supporting the case with list/collection. How can I fix this.