Is it possible to have a 'Partialview' in WPF?

Asked

Viewed 24 times

0

I was wondering if it is possible to implement the concept of partialview in a WPF View. Something like a system of tabs, which changes the content of the grid but does not alter the layout of the view. I just need to know how to get the content of the daughter view uploaded into the parent view.

1 answer

1


As a system of tabs in wpf there is Tabcontrol, where inside there can be n Tabitem, which are the tabs themselves.

Ex:

<Window x:Class="WpfApp1.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:local="clr-namespace:WpfApp1"
    mc:Ignorable="d"
    Title="MainWindow" Height="450" Width="800">
<Grid>
    <TabControl>
        <TabItem Header="Aba 1">

        </TabItem>

        <TabItem Header="Aba 2">

        </TabItem>

    </TabControl>
</Grid>

inserir a descrição da imagem aqui

  • Thanks man. It helped a lot

  • 3

    No reason, buddy, I’m glad that’s what you needed!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.