Владелец окна, чтобы tabitem в на элемент управления TabControl
I created a new window (Project->Add WPf Window) I can't see it on page 2 (as a parent) is displayed, but not where I would like it in C# it's easy to create Parent, in Wpf I don't understand which one to use between Owner, Parent, Child
Что я уже пробовал:
<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"> <DockPanel HorizontalAlignment="Left" Height="411" LastChildFill="False" Margin="0,0,0,0" VerticalAlignment="Top" Width="782" RenderTransformOrigin="0.5,0.5" Cursor="Hand" Background="#FF230FE6"> <StackPanel Orientation="Horizontal" DockPanel.Dock="Bottom" Margin="2,5" Background="#FFAE2608" Height="36"> <Button Name="btnPreviousTab" Width="70">Prev.</Button> <Button Name="btnNextTab" Width="70">Next</Button> <Button Name="btnSelectedTab" Width="70">Selected</Button> </StackPanel> <TabControl Name="tcSample" Width="735"> <TabItem x:Name="Pagina1" Header="General"> <Label Content="Test here..." /> </TabItem> <TabItem x:Name="Pagina2" Header="Security" /> <TabItem x:Name="Pagina3" Header="Details" /> </TabControl> </DockPanel> </Window> private void btnSelectedTab_Click(object sender, RoutedEventArgs e) { Window oWindow = new Window1(); Pagina2.Content = oWindow.Content; oWindow.Show(); }