Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. MultiPage-Application - Navigation

MultiPage-Application - Navigation

Scheduled Pinned Locked Moved C#
wpfcsharpcsshelptutorial
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    PingOfDeath1983
    wrote on last edited by
    #1

    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

    D 1 Reply Last reply
    0
    • P PingOfDeath1983

      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

      D Offline
      D Offline
      dan sh
      wrote on last edited by
      #2

      There is a WPF forum at CP. It would be better if you post there.

      "No matter how many fish in the sea; it will be so empty without me." - From song "Without me" by Eminem

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups