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

TabControl.SelectedContent contains a string

3 Answers 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Carlos Marcão
Top achievements
Rank 2
Carlos Marcão asked on 17 Aug 2010, 06:23 PM
Hi there!

I'm trying to use the control ArtOfTest.WebAii.Silverlight.UI.TabControl and everything (At least what I used) working perfectly except property Content. I expected to find a reference to the control that is beeing displayed by selected tab but I only found an object with type string (at least I invoked the GetType over this property and I received System.String).

My reference to TabControl is ok because I'm able to check wich TabItems are available.
If Content property is not working well, let me know if you have an workaround (I have framework version 2010.2.806.0 and Silverlight 3.0).

Thanks in advance,

Carlos Marcão

3 Answers, 1 is accepted

Sort by
0
Accepted
Konstantin Petkov
Telerik team
answered on 18 Aug 2010, 09:53 AM
Hello Carlos,

We have recently improved the TabControl wrapper in regards to the TabItems so I'm happy to find it works fine for you.

The .Content property is indeed a bit useless at the time being. The framework is unable to get the object behind this type of properties in Silverlight. Improving that is in our ToDo list and we should solve that for a future version of the product.

Looking at the TabControl visual tree I think you can get the content through the ContentPresenter sub element of the TabControl I selected in the attached image. The XAML I used is as simple as this:

<!-- Create a simple TabControl in XAML. -->
<controls:TabControl x:Name="tab1" Canvas.Top="20" Canvas.Left="20" Height="200" Width="300" />

Note this is a capture of the default TabControl visual tree so in case of custom template the visual tree changes.

Please let us know whether that helps or if you need further assistance.

Kind regards,
Konstantin Petkov
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
0
Carlos Marcão
Top achievements
Rank 2
answered on 19 Aug 2010, 11:32 AM
Hello Konstantin .
Many thanks for your attention.

As far as I understood your suggestion, I'm only able to see the content of the first tab. Is it true or I misunderstood something?
If possible for you, let me know the name of the application that you are using to explore thesilverlight  controls tree.

Waiting for your feedback,

Carlos Marcão

0
Konstantin Petkov
Telerik team
answered on 19 Aug 2010, 11:37 AM
Hello Carlos,

In the sample I used I had the first tab selected but it shouldn't matter which one you work with.

I'm using the WebUI Test Studio built-in DOM Explorer component to explore the Silverlight Visual Tree. It helps inspecting both HTML and Silverlight applications.

Regards,
Konstantin Petkov
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
General Discussions
Asked by
Carlos Marcão
Top achievements
Rank 2
Answers by
Konstantin Petkov
Telerik team
Carlos Marcão
Top achievements
Rank 2
Share this question
or