We've noticed the IsChecked property does not respond to changes in the ViewModel. The properties the buttons IsChecked properties are bound to raise PropertyChanged events in the ViewModel, but do not respond to the event. Any ideas why they would not respond to changes?
We're using the most current 2010 release in a .Net 3.5 WPF application using the MVVM pattern.
5 Answers, 1 is accepted
0
Hello kilhoffer,
In order to get IsChecked working, you should first set the "IsToggle = True".
Hope this will helps you.
Sincerely yours,
Miro Miroslavov
the Telerik team
In order to get IsChecked working, you should first set the "IsToggle = True".
Hope this will helps you.
Sincerely yours,
Miro Miroslavov
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
kilhoffer
Top achievements
Rank 1
answered on 06 Jul 2010, 02:37 PM
I'm afraid the problem is more complicated than that. If I set IsToggle to true, I can change it's IsChecked property programatically from the ViewModel and everything seems to work, but once I toggle it by clicking the SplitButton itself, programatically switching the IsChecked property from the ViewModel no longer has any effect. We need this button's state to be manipulated programatically, not just by clicking the button itself. Any ideas why it works from the ViewModel up until the point it's manually clicked but not thereafter?
0
Accepted
Hi kilhoffer,
Can you make sure the you bind the IsChecked property TwoWay?
If it is not set, default is OneWay, which is causing the problem.
Greetings,
Miro Miroslavov
the Telerik team
Can you make sure the you bind the IsChecked property TwoWay?
If it is not set, default is OneWay, which is causing the problem.
Greetings,
Miro Miroslavov
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items
0
kilhoffer
Top achievements
Rank 1
answered on 08 Jul 2010, 01:55 PM
You're right, that was the cause. I had not explicitly set the mode to TwoWay because WPF's default binding mode is already TwoWay. Did Telerik override this in the SplitButton control to make the default OneWay?
Here's the MSDN article that states TwoWay binding mode is the default on the intrinsic controls.
Thanks for the help. It's all working as expected now.
Here's the MSDN article that states TwoWay binding mode is the default on the intrinsic controls.
Thanks for the help. It's all working as expected now.
0
Hi kilhoffer,
My fault - I thought it's about Silverlight. Yes in WPF for the intrinsic controls the default value is TwoWay. But IsChecked is custom defined property and it is defined with default value of OneWay (for compatibility reasons with Silverlight).
Greetings,
Miro Miroslavov
the Telerik team
My fault - I thought it's about Silverlight. Yes in WPF for the intrinsic controls the default value is TwoWay. But IsChecked is custom defined property and it is defined with default value of OneWay (for compatibility reasons with Silverlight).
Greetings,
Miro Miroslavov
the Telerik team
Do you want to have your say when we set our development plans?
Do you want to know when a feature you care about is added or when a bug fixed?
Explore the
Telerik Public Issue Tracking
system and vote to affect the priority of the items