Minor bug

3 posts, 1 answers
  1. Ben Hayat
    Ben Hayat avatar
    901 posts
    Member since:
    May 2008

    Posted 09 Aug 2008 Link to this post

    In order to work with each tab item (page) content, I need to turn the "IsSelected" off from the other item tabs and turn On the tab item I need to work on.

    When I do that in Blend, I can see the IsSelected On or Off and the particular page is activated, however at runtime the first page always gets activated. By looking at the XAML code, I notice more than one tab Item the "IsSelected" is set to "True", therefore at runtime, it gets confused and the first one comes on. I'm not sure this is Blend problem or control problem and I thought I report it.

    Thanks!
    ..Ben
  2. Answer
    Miroslav
    Admin
    Miroslav avatar
    922 posts

    Posted 12 Aug 2008 Link to this post

    Hi Ben,

    Blend does surprise me from time to time.

    All the controls that are visible on the Blend surface are actually "live", i.e. all their internal logic is preserved, you can even debug them while they are running there.

    When you set the IsSelected = true of a TabItem, the TabControl makes sure that no other item is selected (sets the other properties to false). It seems that when the property is changed by the TabControl Blend does not notice and the Xaml of the TabItem is not changed accordingly - the control is in a state that is not matched by the xaml. When I test it the control runs according to the xaml, i.e. the last item to have IsSelected = true is selected, if no such item exists, the Selected index is used (default value = 0, if at least one item exists)

    I will investigate the disparity though I am not sure that we have control over how Blend generates the Xaml.

    This behavior might be a little frustrating if you have to switch the content often. One workaround would be to use the SelectedIndex property of the TabControl instead of switching the IsSelected properties.

    Thanks for the feedback! I will check whether Blend behaves similarly in other cases as well. And of course, if this turns out to be a bug in the control, you'll get your points.

    All the best,
    Miroslav
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Ben Hayat
    Ben Hayat avatar
    901 posts
    Member since:
    May 2008

    Posted 12 Aug 2008 Link to this post

    Hi Miroslav;

    Blend does surprise me from time to time.
    You are very kind to put it in that phrase ;-)
    I usually say "Blend frustrates the hell out of me, ALL THE TIME" ;-)

    This behavior might be a little frustrating if you have to switch the content often. One workaround would be to use the SelectedIndex property of the TabControl instead of switching the IsSelected properties.
    Excellent solution. Works much better with SelectedIndex. Thank you!
Back to Top