I am learning c# WPF application.
I have a menu which has a dropdown list. In the dropdown there are 3 other items.
Now on clicking an item i want to display the form in the same window.
What i did is that i have created a new wpf form and navigated it from the previous page.
But now i want to open it in the same page itself.
<DockPanel Height="43" HorizontalAlignment="Stretch" Name="dockPanel1"
<Menu Height="47" Name="menu1" Width="Auto" DockPanel.Dock="Top"
VerticalAlignment="Top" HorizontalAlignment="Stretch" >
<MenuItem Header="_Entry Form" >
<MenuItem Header="_Student Details" Name="studentDetails" Click="studentDetails_Click_1"/>
<MenuItem Header="_Faculty Details" Name="facultyDetails" />
<MenuItem Header="E_xit" Name="exit" />
private void studentDetails_Click_1(object sender, RoutedEventArgs e)
// to navigate to a new page
Student std = new Student();
Now i donot want to navigate just display the student page in the same window
Firstly, you'll need to add XAML that represents the
Student class, probably a bunch of
TextBoxes, wrapped in some kind of container, like a
StackPanel, and set the
Visibility property of the container to
When the button is then clicked, you can populate the text boxes (or other UI elements) with the appropriate
Student parameters, then set the container's
Visibility property to
I would really recommend you check out the Model-View-ViewModel (MVVM) pattern, though. There is a bit of a learning curve, but it's well worth the investment.