0
votes

I just did WinRT xaml two way binding between Toggle button and bool dependency property. I am using Converter.

When I clicked toggle button , it invokes ConvertBack() that sets value to the source through property changed event.

Where I am making some internal calculations that may change the bool property so that the dependency property changed event is triggered. This should trigger Convert() to set value to UI from source. But it doesn't. I need to know how to do this?

1
you set the binding mode to TwoWay? - thumbmunkeys
can you show the xaml as well as your converter? - Rico Suter

1 Answers

0
votes

Bindings listen for the PropertyChanged event to fire with the PropertyName set to the Path of the Binding.

Make sure what whatever you are binding to inherits INotifyPropertyChanged in some way (most ViewModels already do this), then whenever you change the value you should call your OnPropertyChanged(*Property Name*) or RaisePropertyChanged(*Property Name*) (for MvvmLight).