I'm trying to control SwipeView programmatically so that based on specific conditions it gets enabled/disabled. Binding the IsEnabled property doesn't seem to work.
Note that hardcoding IsEnabled to "True/False" in the xaml does work as expected. It misbehaves when binded to a value.
Bind SwipeView IsEnabled property.
SwipeView should bind to the property and act accordingly i.e. when IsEnabled = False, it should not open when swiped.
It ignores the binding value.
Microsoft Visual Studio Community 2019 Version 16.8.2

https://github.com/darrabam/SwipeBindingBug
Don't know.
Check your console output - I'm betting there's an error in there somewhere like "Property IsSwipeViewEnabled not found".
Your items in your CollectionView are bound to objects of type String (in your PageViewModel's Items collection). So all those bindings in your DataTemplate are targeting a String object, not the PageViewModel object which contains your IsSwipeViewEnabled property.
If you want the IsEnabled property of the SwipeView in your DataTemplate to target that property on the PageViewModel object, you'll need to use a relative source in your binding. So on your SwipeView, you want the IsEnabled property to look something like this:
IsEnabled="{Binding Source={RelativeSource AncestorType={x:Type local:PageViewModel}}, Path=IsSwipeViewEnabled}}"
That tells the binding to work its way up through the hierarchy to the PageViewModel and use that for binding this particular property.
(Don't forget to declare the local namespace so the XAML knows what a PageViewModel is - inside your ContentPage tag, add xmlns:local="clr-namespace:SwipeBindingBug.ViewModels".)
More on relative bindings: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/data-binding/relative-bindings
@hartez Many thanks for your prompt reply and clear explanation! You are absolutely correct! I don鈥檛 know why I misunderstood swipeview as a page element and not part of the collection / data template scope.
Thanks again,