Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create tab-able content in WPF/C#?
    primarykey
    data
    text
    <p>I have a <code>TabControl</code> in my WPF application. I want my application to basically support multiple "instances" within the single program. For example, think about web browsers, they allow you to have multiple instances of websites in different tabs, I want to achieve similar functionality where my application contains several instances of "sub applications".</p> <p>The problem I currently face is that I have to copy-paste the same XAML to every tab, because each tab has exactly the same markup and UI, but different data. Another problem is that I need functionality to dynamically create those tabs.</p> <p>Here's a screenshot of my application at its current state. As you can see, there are 2 tabs on the top and the second has transparent background since it's inactive.</p> <p><img src="https://i.stack.imgur.com/lhjjh.png" alt="enter image description here"></p> <p>So, how do I create a tab-able system where the UI of the tab remains the same for every tab and I only need to develop with one XAML UI and duplicate that for each tab?</p> <p>Requirements:</p> <ul> <li>Every tab has the same UI.</li> <li>Every tab has different data for the UI elements.</li> <li>As a developer I want to work on the tab's XAML only once and right within Visual Studio.</li> </ul> <p>Ideally I would love a plain simple sample project/code where there is one unstyled tab control and the application upon startup dynamically creates 2-n tabs which all have the same UI, but with different data.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload