Tab headers close button image and content

4 posts, 0 answers
  1. Mario
    Mario avatar
    4 posts
    Member since:
    Jan 2012

    Posted 25 Jan 2012 Link to this post

    I have tested the sample "How to Add Close Button to the Tab Headers" and all is ok but i have 2 questions:
    1) how can i change the image of the header
    2) how can i call to a Page from the tabitems added. I've tried with:

    ...
                TabItemModel x = new TabItemModel();
                x.Title = "TITLE";
                x.Content = new Page1();
                tabItemsModel.Add(x);
    ...

        public class TabItemModel
        {
            public String Title
            {
                get;
                set;
            }
            public Object Content
            {
                get;
                set;
            }
        }

    no success
  2. Mario
    Mario avatar
    4 posts
    Member since:
    Jan 2012

    Posted 25 Jan 2012 Link to this post

    Ok, It goes on with:

                <Setter Property="ContentTemplate">
                    <Setter.Value>
                        <DataTemplate>
                                <ContentControl Content="{Binding Content, Mode=TwoWay}" />
                        </DataTemplate>
                    </Setter.Value>
                </Setter>

    But now the problems are:

    - The the Page don't full the tabitem. How can I make  the content width=auto and height=auto
    - When I select 2 times the same tabitem i got the message : The element is already the child of another element 
     
  3. DevCraft banner
  4. Mario
    Mario avatar
    4 posts
    Member since:
    Jan 2012

    Posted 25 Jan 2012 Link to this post

    <ContentControl VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch" Content="{Binding Content, Mode=TwoWay}" />

    ONLY ONE PROBLEM:

    - When I select 2 times the same tabitem i got the message : "The element is already the child of another element"  
    Is this a bug?

    Thanks
  5. Mario
    Mario avatar
    4 posts
    Member since:
    Jan 2012

    Posted 25 Jan 2012 Link to this post

    That's all: ContentPresenter 

    Thanks to everybody for the help

    :)
Back to Top