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 4092486
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T19:29:50+00:00 2026-05-20T19:29:50+00:00

I have the following problem: i have some data loaded in my application, that

  • 0

I have the following problem:

i have some data loaded in my application, that need to be put in a tab control.

The data is in the format:

class objectType1
{
    string property_1;
    string prorerty_2;
}

class mainObject
{
    string mainProperty_1;
    string mainProperty_2;
    List<objectType1> objectsList;
}

and all the data is loaded in an object of type

List<mainObject> myListofObjects

So far i managed to create the tabitems with respect to myListofObjects item
(ie if the list has 5 objects, 5 tabs are created with the header containing the information mainProperty_1 and mainProperty_2)
now i need to add the data contained in each objectsList into their respective tab…

the mainProperty_1 represents an image, which must be loaded…

<TabControl x:Name="_DataList" Margin="10">
        <!-- Header -->
        <TabControl.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <Image Height="18" Source="{Binding mainProperty_1/>
                    <TextBlock Text="{Binding mainProperty_2}" Margin="2,0,0,0" />
                </StackPanel>
            </DataTemplate>
        </TabControl.ItemTemplate>
        <!-- Content -->
        <TabControl.ContentTemplate>
            <DataTemplate x:Name="objectDataTemplate">
                <Grid Margin="5">
                    <StackPanel Orientation="Horizontal">
                        <Image Source="{Binding property_1}" ToolTip="{Binding property_2}" IsHitTestVisible="false" Stretch="Uniform"/>
                    </StackPanel>
                </Grid>
            </DataTemplate>
        </TabControl.ContentTemplate>
    </TabControl>

I pass the data to the tabcontrol in code behind with

_DataList.ItemsSource = myListofObjects;

this is not working for the content…

the header loads just fine (both image and the text…)

anyone has any idea how to do it?

Thanks a lot!

  • 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-20T19:29:51+00:00Added an answer on May 20, 2026 at 7:29 pm

    your ContentTemplate seems to be wrong:

     <TabControl x:Name="_DataList" Margin="10">
        <!-- Header -->
        <TabControl.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal">
                    <Image Height="18" Source="{Binding mainProperty_1/>
                    <TextBlock Text="{Binding mainProperty_2}" Margin="2,0,0,0" />
                </StackPanel>
            </DataTemplate>
        </TabControl.ItemTemplate>
        <!-- Content -->
        <TabControl.ContentTemplate><!-- its bound to one mainObject -->
            <DataTemplate x:Name="objectDataTemplate">
     <!-- if you wanna bind to something from your objectsList you have to threat it like a list, cause it is :) -->
    
    <ListBox Itemssource={Binding objectsList}>
    <ListBox.ItemTemplate>
        <DataTemplate DataType="{x:Type objectType1}">
           <StackPanel Orientation="Horizontal">
               <Image Source="{Binding property_1}" ToolTip="{Binding property_2}" IsHitTestVisible="false" Stretch="Uniform"/>
           </StackPanel>
        </DataTemplate>
    </ListBox.ItemTemplate>
    </ListBox>
    
            </DataTemplate>
        </TabControl.ContentTemplate>
    </TabControl>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the following problem: Suppose I have some basic counter class Counter .
I have the following problem using template instantiation [*]. file foo.h class Foo {
I have the following problem in my Data Structures and Problem Solving using Java
I have a page in my application that refreshes some content (a list of
I have an application that loads lots of data into memory (this is because
I have a problem in getting some data out from Cassandra using c# and
I have a file (with extension.hgx) that has some data like this: length =
I am developing a silverlight navigation application and have encountered the following problem. I
I have the following problem: I have an HTML textbox ( <input type=text> )
I have the following problem using subversion: I'm currently working on the trunk of

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.