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

Creating a BindableProperty to bind with ViewCell

$
0
0

Hi guys,
I'm currently working on a crossPlatform app, and i had to create a custom Switch component.
the component itself is working just fine, but, it doesn't correct interact with my ViewModel as i intended.

My compement has:
public static readonly BindableProperty PressedProperty = BindableProperty.Create<MobileOnOffButton, bool>(s => s.Pressed, default(bool),BindingMode.TwoWay);

(Pressed is a Property)

My ViewModel is implementing "INotifyPropertyChanged",

and my ViewCell is SetBinding:
swtSelecionado.MyButton.SetBinding(MobileOnOffButton.PressedProperty, c => c.Selecionado);

the problem is, when "Selecionado" set, by:
DetalhesPedidoViewModelOBJECT.Selecionado = true.

the MobileOnOffButton.Pressed is not set true as well.

Anyone know what is missing ?


Viewing all articles
Browse latest Browse all 75885

Trending Articles



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