Telerik Forums RSShttp://www.telerik.com/urn:uuid:1d034d01-34e0-4530-990f-0665af80322bhttp://www.telerik.com/forums/permalink/AU0DHeA0MEWZDwZlr4AyKwBug in RadTabControlHi Moti,
<p >We are handling the event because RadTabControl performs a set of actions when Selector's SelectionChanged event is raised.&nbsp;In other words, RadTabControl is acting as a client for the Selector SelectionChanged event and translates it into another event (that happens to have the same name). You could think of this case as the button example (handling the MouseLeftButtonDown event and firing the Click event) which I gave you in the previous post.<br />
<br />
MSDN also says it is decent way to treat the event:<br />
"Another way to consider the "handled" issue is that you should generally mark a routed event handled if your code responded to the routed event in a significant and relatively complete way."<br />
<br />
</p>
Regards,<br />
Hristo <br />
Telerik
<div class="forumBaloonTop"></div>
<div class="forumBaloon">
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF. <br />
Learn what features your users use (or don't use) in your application. <strong>Know your audience. Target it better. Develop wisely.</strong><br />
<a title="Try EQATEC Application Analytics for Free" alt="Try EQATEC Application Analytics for Free" href="http://www.telerik.com/analytics?utm_source=forum&amp;utm_medium=footer&amp;utm_term=sign-up&amp;utm_content=WPF&amp;utm_campaign=eqatec">Sign up for Free application insights &gt;&gt;</a>
</div>
<div class="forumBaloonBottom"></div>urn:uuid:4bdcf26e-e507-4c11-b59b-24094a495b62http://www.telerik.com/forums/permalink/bvLcSwflEUy1myQJSklbYgBug in RadTabControlActually that's a cool workaround, but I still don't get why should the control mark Selector's SelectionChanged event as handled.<br>
I'll quote&nbsp;<a href="http://msdn.microsoft.com/en-us/library/ms747183.aspx#When_to_Mark_Events_as_Handled" rel="nofollow">MSDN</a>&nbsp;about this:<br>
<br>
<span style="color: #2a2a2a; font-family: 'Segoe UI', 'Lucida Grande', Verdana, Arial, Helvetica, sans-serif; font-size: 13px; line-height: 18px;">There is no absolute rule for when you should mark routed events as handled, either as an application author, or as a control author who responds to existing routed events or implements new routed events. For the most part, the concept of "handled" as carried in the routed event's event data should be used as a limited protocol for your own application's responses to the various routed events exposed in WPF&nbsp;APIs as well as for any custom routed events. Another way to consider the "handled" issue is that you should generally mark a routed event handled if your code responded to the routed event in a significant and relatively complete way.</span><br>
<br>
According to these guidelines, the tab control should not mark the event handled, and then everything will be good.<br>
Unless I'm missing something here?<br>
<br>
Thanks, Moti.<br>urn:uuid:8055541f-9f7d-4385-935d-68746fca2143http://www.telerik.com/forums/permalink/H1RVgH2fhUOTXWh0b8ohQwBug in RadTabControlHello Moti,
<p >The TabControl has to handle the Selector event internally when changing the selection. It is the right way to treat the event. In other words, Selector event is fired correctly by Selector control but it is handled by the TabControl. Then TabControl fires its own&nbsp;SelectinoChanged event to notify the user and preserve the API.<br />
<br />
Actually, the case is like using the Button control and trying to attach a handler to the MouseLeftButtonDown event. The MouseLeftButtonDown event is handled internally by the Button class (to perform a click action) and the event handler will not be called.<br />
However you have the option to attach a handler that gets called by the handled events too. You could do it by using the AddHandler method and passing true for the hadnledEventsToo parameter like this:<br />
<br />
</p>
<div class="tFormatCodeBlock supportThreadCodeBlock" style="border: 1px solid #7f9db9; overflow-y: auto;" id="highlighter_19124">
<div style="background-color: #ffffff;"><span style="margin-left: 0px !important;"><code style="color: #000000;">control.AddHandler(</code><code style="color: #006699; font-weight: bold;">event</code><code style="color: #000000;">, handler, </code><code style="color: #006699; font-weight: bold;">true</code><code style="color: #000000;">)</code></span></div>
</div>
<br />
Regards,<br />
Hristo <br />
Telerik
<div class="forumBaloonTop"></div>
<div class="forumBaloon">
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF. <br />
Learn what features your users use (or don't use) in your application. <strong>Know your audience. Target it better. Develop wisely.</strong><br />
<a title="Try EQATEC Application Analytics for Free" alt="Try EQATEC Application Analytics for Free" href="http://www.telerik.com/analytics?utm_source=forum&amp;utm_medium=footer&amp;utm_term=sign-up&amp;utm_content=WPF&amp;utm_campaign=eqatec">Sign up for Free application insights &gt;&gt;</a>
</div>
<div class="forumBaloonBottom"></div>urn:uuid:16df275d-d539-40e3-a6a7-37d8207b66ebhttp://www.telerik.com/forums/permalink/XSffFjnV40CmpzfYIHtm6wBug in RadTabControlFirst of all, thank you for the reply :)<br>
<br>
But I did not understand how keeping the legacy API (which is the one I reverted to using in my region adapter) doesn't allow you to make the selector API functional.<br>
Worst case is when the legacy SelectionChanged event fires you also fire Selector's &nbsp;<span style="font-size: 14px;">SelectionChanged...<br>
</span>Given the information I have right now, this sounds quite possible and not complex at all.urn:uuid:8fb6582e-f186-4a31-89bb-fca069eeef57http://www.telerik.com/forums/permalink/Lli2j4bxMUqJu_ygae7vVwBug in RadTabControlHi Moti,
<p >Thank you for contacting us about the issue. I am really sorry about the caused inconvenience.<br />
<br />
Let me start by some background about the issue and I hope you will get our point in the end.<br />
The TabControl is a control that went many refactoring procedures. Initially it was not a selector control and has its own selection changed event. This means, own event arguments and signature. Later on in its lifecycle we decided to improve the selection logic and inherited the selector control. But we already had exposed a selection API that have to stay functional without changes. Unfortunately we had no way to preserve the old event and introduce a new one. So the solution was to handle the inner selection event and re-rise it as own event preserving the legacy API.<br />
<br />
I would like to thank you again for your feedback. Don't hesitate to contact us should you need more info.<br />
<br />
</p>
Regards,<br />
Hristo <br />
Telerik
<div class="forumBaloonTop"></div>
<div class="forumBaloon">
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF. <br />
Learn what features your users use (or don't use) in your application. <strong>Know your audience. Target it better. Develop wisely.</strong><br />
<a title="Try EQATEC Application Analytics for Free" alt="Try EQATEC Application Analytics for Free" href="http://www.telerik.com/analytics?utm_source=forum&amp;utm_medium=footer&amp;utm_term=sign-up&amp;utm_content=WPF&amp;utm_campaign=eqatec">Sign up for Free application insights &gt;&gt;</a>
</div>
<div class="forumBaloonBottom"></div>urn:uuid:99bffb59-1297-4b7d-baa3-5538b6ffb940http://www.telerik.com/forums/permalink/Wfu_mZcSfUu6o1U4tv-5QABug in RadTabControlHi.<br>
I found an issue the RadTabControl for WPF. I placed a prism region on the&nbsp;RadTabControl, and I did not use the region adapter the telerik offers online since I need a regular region and not an all-active region.<br>
So the region adapter in use was prism's SelectorItemsSourceSyncBehavior.<br>
New tabs opened as expected, but for navigation to tabs - when I resolved an already resolved view into the region, the view's tab didn't get selected.<br>
<br>
I debugged the adapter and found out that it wasn't getting any SelectionChanged events from the control, so I tested it in a new demo app.<br>
I added an event handler to&nbsp;RadTabControl.SelectionChanged and all the events did fire as expected. BUT - when I casted the control into a selector and added an event handler to ((Selector)radTab).SelectionChanged - no events fired.<br>
Since the control actually inherits from Selector, I consider this a bug.<br>
<br>
Eventually I just copied prism's adapter code and changed the Selector parts into&nbsp;RadTabControl - and it works. But I don't consider this a good solution for the long run.<br>
<br>
Thanks, Moti.