Let's create the UI interface to host a very basic tab control with a few tab items inside it. Perform the following steps:
- From the Solution Explorer window, open the MainWindow.xaml file.
- Inside the default Grid panel, add the TabControl with two TabItem controls as shown in the following code:
<Grid> <TabControl> <TabItem Header="Tab 1"> <TextBlock Text="You have selected 'Tab 1'" FontSize="30" Margin="4"/> </TabItem> <TabItem Header="Tab 2"> <TextBlock Text="You have selected 'Tab 2'" FontSize="30" Margin="4"/> </TabItem> </TabControl> </Grid>
- Now run this application and you will see the following UI, which contains two tabs inside it:
- Close the application and return to the XAML editor to add another...