MultiPage-Application - Navigation
-
Hi, I cant figure out how to switch my customcontrols when clicking on a menubar-button. I have a MainWindow containing the following XAML:
<DockPanel x:Name="MainWindow">
<Menu Name="dropDownMenu" DockPanel.Dock="Top"> <MenuItem Name="dropDownPage1" Header="File"> <MenuItem Header="Page1" Click="dropDown\_Page1"/> </MenuItem> <MenuItem Name="dropDownPage2" Header="File"> <MenuItem Header="Page2" Click="dropDown\_Page2"/> </MenuItem> </Menu> <Grid Name="gridMainContent" DockPanel.Dock="Top"> <TextBlock>placeholder main content</TextBlock> </Grid> <Grid Name="gridStatusBar" DockPanel.Dock="Bottom"> <TextBlock>placeholder statusbar</TextBlock> </Grid> </DockPanel>
The task is when clicking on one menubutton i.e. "dropDown_Page1", changing the content of the grid "gridMainContent". Is there a way to place customcontrols into a grid without code in any *.cs File ? It would be wonderfull if somebody could help me on this. Cause I´m new to WPF, I welcome you to show me other ways of doing this! Thx! PingOfDeath
-
Hi, I cant figure out how to switch my customcontrols when clicking on a menubar-button. I have a MainWindow containing the following XAML:
<DockPanel x:Name="MainWindow">
<Menu Name="dropDownMenu" DockPanel.Dock="Top"> <MenuItem Name="dropDownPage1" Header="File"> <MenuItem Header="Page1" Click="dropDown\_Page1"/> </MenuItem> <MenuItem Name="dropDownPage2" Header="File"> <MenuItem Header="Page2" Click="dropDown\_Page2"/> </MenuItem> </Menu> <Grid Name="gridMainContent" DockPanel.Dock="Top"> <TextBlock>placeholder main content</TextBlock> </Grid> <Grid Name="gridStatusBar" DockPanel.Dock="Bottom"> <TextBlock>placeholder statusbar</TextBlock> </Grid> </DockPanel>
The task is when clicking on one menubutton i.e. "dropDown_Page1", changing the content of the grid "gridMainContent". Is there a way to place customcontrols into a grid without code in any *.cs File ? It would be wonderfull if somebody could help me on this. Cause I´m new to WPF, I welcome you to show me other ways of doing this! Thx! PingOfDeath