Sync dependency properties value in call back method

2 posts, 0 answers
  1. Muhammad
    Muhammad avatar
    24 posts
    Member since:
    Mar 2012

    Posted 25 Oct 2013 Link to this post

    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

  2. Ventzi
    Admin
    Ventzi avatar
    114 posts

    Posted 29 Oct 2013 Link to this post

    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 >>
  3. DevCraft banner
Back to Top