InterestedIn and OnViewModelPropertyChanged not firing when property is being updated from UI

Topics: Issues / bugs
Mar 27, 2013 at 10:35 PM
Hi Everybody,

I try to take advantage of the InterrestedIn attribute in order to check the change on 2 properties from an other viewmodel.
Both viewmodel are kept alive in a list of viewmodel used as source of items to a tab controller.

The OnViewModelPropertyChanged is firing when the viewmodel is created and the property are being assigned but it's not firing if the properties are modified via the UI.

Is it normal? Am I missing something in the way the feature is supposed to work?

I can easily provide an example just let me know where to send it if you need one.

Thank you.

Regis
Developer
Mar 28, 2013 at 12:16 AM
Did you put binding mode on twoway in the ui?
Mar 28, 2013 at 3:15 PM
If I put a breakpoints on the set of the properties I hit it as soon as I modify the text via the UI so the properties in the viewmodel are really modified. But I will try to add twoway binding

Thanks
Mar 28, 2013 at 3:25 PM
I try adding twoways binding mode but it didn't make any difference. I should not need to add a binding mode as I already have UpdateSourceTrigger=PropertyChanged, shouldn't I?
Coordinator
Mar 28, 2013 at 3:26 PM
Edited Mar 28, 2013 at 3:26 PM
Please provide a repro.

You can create an issue here.
Mar 28, 2013 at 4:27 PM
I try adding twoways binding mode but it didn't make any difference. I should not need to add a binding mode as I already have UpdateSourceTrigger=PropertyChanged, shouldn't I?
Coordinator
Mar 30, 2013 at 6:53 AM
I cannot yet find the repro. The binding should look like this:

<TextBox Text="{Binding MyProperty}" />

In SL it should be:

<TextBox Text="{Binding MyProperty, Mode=TwoWay}" />

How are you testing this? By checking the property setter? Note that the setter and getters are just wrappers around the SetValue and GetValue, and that Catel sometimes calls these methods directly. The best way to test is to check the OnPropertyChanged method.
Apr 1, 2013 at 3:09 PM
Please discard the archive, I will create a ticket using the link you provided. Sorry about that
Apr 8, 2013 at 7:52 PM
Thank you for looking into this. I wasn't aware the tabcontrol behavior. I will look into custom lifetime management to be sure I handle everything correctly.

Thank again