TabControl.SelectedContent contains a string

4 posts, 1 answers
  1. Carlos Marcão
    Carlos Marcão avatar
    9 posts
    Member since:
    Jun 2010

    Posted 17 Aug 2010 Link to this post

    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
  2. Answer
    Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 18 Aug 2010 Link to this post

    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
  3. Carlos Marcão
    Carlos Marcão avatar
    9 posts
    Member since:
    Jun 2010

    Posted 19 Aug 2010 Link to this post

    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

  4. Konstantin Petkov
    Admin
    Konstantin Petkov avatar
    1911 posts

    Posted 19 Aug 2010 Link to this post

    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
Back to Top