I have a tabcontrol in my window, inside each tabitem I want to have a different page.
I can achieve this by making a Frame inside the TabItem and in the behind code use for example:
frame1.Content = new Pages.MyPage()
How can I do the same thing in XAML?
<TabItem>
<Frame Source="MyPage.xaml" />
</TabItem>
you probably don't need the frame. Something like this should work.
<TabControl>
<TabItem>
<MyPage Name=frame1 />
</TabItem>
<TabItem>
<MyPage Name=frame2 />
</TabItem>
</TabControl>
If you want the frame just do:
<TabItem>
<Frame>
<MyPage Name=frame1 />
</Frame>
</TabItem>