I have Xaml WPF window with TabControl
inside. Each TabItem
of it contains a page inside frame like this:
<TabItem >
<TabItem.Header>
Users
</TabItem.Header>
<Frame Source="/Views/UsersPage.xaml" />
</TabItem>
<TabItem>
<TabItem.Header>
Stats
</TabItem.Header>
<Frame Source="/Views/OrdersPage.xaml"/>
</TabItem>
The problem is when i open this window all pages inside frames loads simultaneously, so if , eg, I put MessageBox
on each page load i got a lot of them. I want my pages to load only when I click on corresponding tab header.
How can i achieve this?