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?
It is the root window of an XAML application which provides minimize/maximize option, Title bar, border, and close button. It also provides the ability to create, configure, show, and manage the lifetime of windows and dialog boxes. The hierarchical inheritance of Window class is as follows −
XAML Popup in WPF. A XAML Popup represents a popup window. A popup window is a window that floats over a page or window providing functionality for some quick action, for example a login control on a page or to provide an animated popup tip. Fortunately, WPF comes with a Popup control to provide this functionality.
You typically use a panel or items control as the immediate child of a Page, so that you can have the page contain and compose multiple elements of a UI. You can also specify app bars, with the TopAppBar and BottomAppBar properties. You must use property element syntax for these properties to contain the AppBar values in XAML.
It is the root window of an XAML application which provides minimize/maximize option, Title bar, border, and close button. It also provides the ability to create, configure, show, and manage the lifetime of windows and dialog boxes.
<TabItem>
<Frame Source="MyPage.xaml" />
</TabItem>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With