This is a migrated thread and some comments may be shown as answers.

Sync dependency properties value in call back method

1 Answer 60 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Muhammad
Top achievements
Rank 1
Muhammad asked on 25 Oct 2013, 08:07 AM
I would be greatful to any one who can suggest me solution for my problem
i have a custom usercontrol ,i have a selectedvalue dependency property and selected item dependency property on the control ,how we can sync two properties value when any one of them is changed before raising the selectionchanged event. if we change selectedvalue it should first sync selecteditem and then raise selectionchanged event

and if we change selecteditem it should sync selectedvalue and then raise selectionchanged event.

kind regards

1 Answer, 1 is accepted

Sort by
0
Ventzi
Telerik team
answered on 29 Oct 2013, 09:09 AM
Hello Muhammad,

 If I understand you correctly you've created a custom RadComboBox and you like to synchronize the properties in your ViewModel bound to the SelectedItem and SelectedValue properties of the custom control. If the binding of the SelectedItem and SelectedValue properties is TwoWay binding, the RadComboBox first updates the bound properties and then raise the SelectionChanged event. In this case you could plug your synchronization logic in the setter of the SelectedItem and SelectedValue properties in your ViewModel.

Hope this helps.

Regards,
Ventzi
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
ComboBox
Asked by
Muhammad
Top achievements
Rank 1
Answers by
Ventzi
Telerik team
Share this question
or