Wpf TabControl, can I organize each tab in a different class?

Mostly in my MainWindow class, it gets crowded. My main question is: how to add events to another class?

So, I tried adding tabControl ... and I wonder if each tab control can be in a separate xaml and / or class.

An example would be very useful: P Thank you

+5
source share
2 answers
<Window .......  xmlns:uControl="clr-namespace:YOURPROJECT" >


<TabItem>
    <uControl:UserControl1/>
</TabItem>

Two links that should help:

.. and for your next problem: call-a-parent-method-from-UserControl

+5
source

TabItem , , . , , UserControl, TabItems .

<TabControl>
    <TabItem>
        <my:UserControl1 />
    </TabItem>
    <TabItem>
        <my:UserControl2 />
    </TabItem>
</TabControl>

"" , UserControls.

+3

All Articles