Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3356340
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T02:30:10+00:00 2026-05-18T02:30:10+00:00

I am having a problem when attempting to host a UserControl as Tab Content

  • 0

I am having a problem when attempting to host a UserControl as Tab Content within a Tab Item in a TabControl.

My code is structured as follows:

I have a view model which is supposed to be rendered into a View via a DataTemplate.

<DataTemplate x:Key="TabItemContentTemplate" DataType="{x:Type ViewModels:MyViewModel}">
  <Views:MyView />
</DataTemplate>

I would like to present this view in
a TabControl (actually a
XamTabControl, but either way, the
issue remains.)

   <UserControl>
        <UserControl.Resources>
        <DataTemplate x:Key="TabItemHeaderTemplate">
                <StackPanel>
                  <TextBlock Text="{Binding Path=Name}" />
                  <TextBlock Text="{Binding Path=Description}"/>              
                </StackPanel>
        </DataTemplate>
            <DataTemplate x:Key="TabItemContentTemplate" DataType="{x:Type ViewModels:MyViewModel}">
              <Views:MyView />
            </DataTemplate>
        <Style x:Key="TabItemContainerStyle" TargetType="Controls:TabItemEx">
          <Setter Property="Header" Value="{Binding}"/>
          <Setter Property="HeaderTemplate"
                  Value="{DynamicResource TabItemHeaderTemplate}"/>
          <Setter Property="Content" Value="{Binding}"/>
          <Setter Property="ContentTemplate"
                  Value="{DynamicResource TabItemContentTemplate}"/>
        </Style>                   
      </UserControl.Resources>
      <Grid >
       <Controls:XamTabControl 
        ItemsSource="{Binding Items}"
        ItemContainerStyle="{DynamicResource TabItemContainerStyle}"
        TabStripPlacement="Left"
        TabLayoutStyle="SingleRowAutoSize"
        AllowTabClosing="True"                               
        Grid.Row="1"
        TabItemCloseButtonVisibility="WhenSelectedOrHotTracked">
        </Controls:XamTabControl>
      </Grid>
    </UserControl>

The issue is that the content does not render. The Tab header does render fine, however, there is no content in the tabs.

I am fairly certain the issue lies within the View/Viewmodel mapping as when I change the templates to the following, I do get content rendered:

<DataTemplate x:Key="TabItemHeaderTemplate">
  <Grid>
    <TextBlock Text="{Binding Header}"/>
    <Ellipse Fill="Red" Width="40" Height="40" Margin="0,20,0,0"/>
  </Grid>
</DataTemplate>
<DataTemplate x:Key="TabItemContentTemplate">
  <Ellipse Fill="Green"/>
</DataTemplate>
<Style x:Key="TabItemContainerStyle" TargetType="Controls:TabItemEx">
  <Setter Property="Header" Value="{Binding}"/>
  <Setter Property="HeaderTemplate"
          Value="{StaticResource TabItemHeaderTemplate}"/>
  <Setter Property="Content" Value="{Binding}"/>
  <Setter Property="ContentTemplate"
          Value="{StaticResource TabItemContentTemplate}"/>
</Style>

Does anyone have an idea what I am doing wrong here?

thanks in advance!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-18T02:30:11+00:00Added an answer on May 18, 2026 at 2:30 am

    Solved this. the BAML was corrupted due to a re-name operation! 🙁

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Having a problem getting a TreeView control to display node images. The code below
I'm having a problem with my Seam code and I can't seem to figure
I'm having a strange problem while attempting to transform a blocking socket server into
I'm having a problem with a simple form where i'm attempting to fire an
I am having a problem with code that worked fine in .NET 2.0 but
I'm having a problem here. How you can see on the code below, I
I am having a problem with my code. Whenever i run the program, the
I've been having a problem with passing variables between classes. I have one class
I'm a django newbie and have been having a problem. In my project root
We're having problem with a huge number of legacy stored procedures at work. Do

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.