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

RadOutlookBar and RadOutlookBarItem SelectionChanged call hierarchy

1 Answer 104 Views
OutlookBar
This is a migrated thread and some comments may be shown as answers.
Daniel
Top achievements
Rank 1
Daniel asked on 02 May 2011, 10:35 AM
Hello Telerik Team,

I have a RadOutlookBar, in which is currently one view that inherits from RadOutlookBarItem. In that view I overrided the OnIsSelectedChanged-Method from RadOutlookBarItem.
In the view, that contains the RadOutlookBar-Control, I added an eventhandler to the event PreviewSelectionChanged. So when I started the Application with the View, following methods are called:

1. OnIsSelectedChanged of the RadOutlookBarItem (oldvalue=false, newvalue=true)
2. The event PreviewSelectionChanged of the RadOutlookBar is fired (and certainly my eventhandler is called)

And if SelectionChangedEventArgs.Handled is set to true
3. OnIsSelectedChanged of the RadOutlookBarItem(oldvalue=true, newvalue=false)

Why is OnIsSelectedChanged called before the PreviewSelectionChanged-Event is fired?

Further Question:
If I click on the unselected OutlookBarItem, at first PreviewSelectionChanged from OutlookBar ist fired, if the Handled-Property is set to true, the OnIsSelectedChanged-Method of the Item ist called twice (first time with newValue = false, the second time with newValue = true)

Why is the OnIsSelectedChanged-Method called twice?

1 Answer, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 05 May 2011, 10:54 AM
Hi Daniel,

We made several changes to the TabControl selection logic. However we didn't want to introduce to many breaking changes with the new release. Thus we couldn't change the PreviewSelectionChanged event implementation to be exact as users expect to be. Currently the preview event is fired after the selection properties are synchronized. Thus the TabItem's event related to IsSelected property is raised before the preview event in case the selection is changed via that property. Also when changing the selection with IsSelected property of the item and handling the preview event the IsSelectedChanged is fired twice (once before the preview and once after the preview when the selection is reversed).

We have already logged item about that feature in our public issue tracking system. You can track its status and vote for it through following link: http://www.telerik.com/support/pits.aspx#/public/silverlight/5811

Hope this helps.

Best wishes,
Hristo
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
Tags
OutlookBar
Asked by
Daniel
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Share this question
or