Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 75885

TwoWay Binding fails to fire in Windows 8.1 phone and Store app when using SwitchCell ! - Android OK

$
0
0

Hello,

I have been seeing some strange behaviour with PCL based solutions using SwitchCells where the TwoWay Binding seems not to work in the Phone and Store 8.1 Apps.

I have a multi target project that is using MVVMlight and provides all that is needed by the calling clients.

I have a view - View Model - Model with a simple list bound to a collection of simple model items (text & Boolean Fields )

I have been pulling my hair out for days trying to figure out why the binding seemed never to fire. I have for sake of speed been using the windows store app as the test client. After much investigation and debugging I found that the View when loaded would call the View Model and then in turn the Model , firing off the get / set property setters. However when I then used the switchcell to update the boolean the setter would never fire. The same behaviour appeared when using the phone 8.1 app.

Being new to this the natural assumption is that your an idiot and your doing something wrong ( could still be the case ! )

Out of chance I tested the solution on my android device and surprise surprise i was stunned / pleased to see that the setter fired when the switch was changed. I then repeated the test on a silverlight phone project I created and that worked in the same emulator that the non silverlight app failed in.

I haven't had a chance to test the code on a IOS device as yet but i'm guessing that the app will work as designed.

So there's either a setting in the universal Apps that should be set to fire TwoWay updates to the underlying view model or there's a bug in the forms support for those version.

Anyone seen this / care to comment ??


Viewing all articles
Browse latest Browse all 75885

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>