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

DataTemplateSelector (and other *Selector) no longer DependencyObject?

5 Answers 96 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
gk
Top achievements
Rank 1
gk asked on 20 Oct 2011, 07:40 PM
in Q3 2011 Beta, Telerik.Windows.Controls.DataTemplateSelector (and other *Selectors) no longer inherit DependencyObject (System.Windows)?
I noticed this in in the internal builds after Q2 2011.9.20 too, they now just inherit Object.

Is this an oversight or intended?
Thanks, GK

5 Answers, 1 is accepted

Sort by
0
Valeri Hristov
Telerik team
answered on 21 Oct 2011, 09:29 AM
Hi Gk,

This change is intended because the DependencyObject base class lead to problems that have no other workarounds. I can provide more information if you are interested...

Greetings,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Brian Sayatovic
Top achievements
Rank 1
answered on 25 Jan 2012, 10:07 PM
I just tried upgrading and got bit by this same problem.  Can I have the same details?  Do you have any suggested work-arounds?
0
Valeri Hristov
Telerik team
answered on 27 Jan 2012, 08:52 AM
When we made the *Selector clases DO we started receiving XAML parser exceptions in our themes. It is possible to reproduce the problem in a very simple application with no Telerik control inside, which made us think that it is caused by a bug in the Silverlight runtime. We were unable to find a workaround, hence we had to revert to simple objects. In addition, the WPF *Selector classes are plain objects, hence the code in the two platforms would have been different, which something we want to avoid.

Kind regards,
Valeri Hristov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Eugene
Top achievements
Rank 1
answered on 30 Oct 2012, 08:18 PM
We used to use dependency properties in the selector to give the selector extra context. Is there a way we can continue with using dependency properties in the selector?
0
Miroslav Nedyalkov
Telerik team
answered on 02 Nov 2012, 11:26 AM
Hello Eugene,

As the StyleSelector doesn't inherit from the DependencyObject class it cannot have any DependencyProperties and you can add only simple CLR properties to it. Sorry for the inconvenience caused.

Regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
General Discussions
Asked by
gk
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Brian Sayatovic
Top achievements
Rank 1
Eugene
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or