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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:17:16+00:00 2026-05-25T03:17:16+00:00

I am writing an application in which I utilize a tab control which will

  • 0

I am writing an application in which I utilize a tab control which will start with one tab open but allows the user to open multiple other tabs.

Each tab that is openned should have a treeview inside which I fill using databinding when the user loads a file.

I am new to WPF but I feel as if there is a way in which I can create a template containing each of the elements the TabItems should contain. How can I do this using templates? Right now my WPF for the tab items is the following

<TabItem Header="Survey 1">
        <TreeView Height="461" Name="treeView1" VerticalAlignment="Top" 
                  Width="625" Margin="0,0,6,0" ItemTemplateSelector="{StaticResource TreeviewDataSelector}" />
 </TabItem>
  • 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-25T03:17:17+00:00Added an answer on May 25, 2026 at 3:17 am

    I think you want something like this:

    <Window x:Class="TestWpfApplication.Window1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Window1" Height="300" Width="300">
    <Window.Resources>
        <DataTemplate x:Key="TabItemTemplate">
            <TreeView Height="461" Name="treeView1" VerticalAlignment="Top" 
                        Width="625" Margin="0,0,6,0" ItemTemplateSelector="{StaticResource TreeviewDataSelector}" />
        </DataTemplate>
    
    </Window.Resources>
    <Grid>
        <TabControl ItemsSource="{Binding ListThatPowersTheTabs}"
                    ItemTemplate="{StaticResource TabItemTemplate}">
        </TabControl>
    </Grid>
    

    You basically create re-usable templates as static resources which you refer to by their key name.

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

Sidebar

Related Questions

I'm writing an application which will have two Activities, when the user presses the
I am writing an application which shows a user one thing to vote on,
I am writing an application which lets the user pick one photograph from a
I've been writing an application which will need to expand environment strings in a
I am writing an application which is going to allows users to change the
I'm writing an application which plays multiple sounds concurrently, each sound needs to be
I'm writing C# application which saves picture box screen to JPEG files. One thread
I'm writing an application which utilises tables which can be printed if the user
I am writing an application which encrypts and decrypts the user notes based on
I've recently started working on a new application which will utilize task parallelism. I

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.