0

I have created two WindowSurface (WPF), and I want to navigate betwen them.

I've created a simple button with the following code :

SurfaceWindow2 sw2 = new SurfaceWindow2();
sw2.Show();

This on displays the second SurfaceWindows but in a new Window.

What I want to do is : Host for example many SurfaceWindow in a root one, so I can show or hide them easily.

Any help ?

Wassim AZIRAR
  • 10,823
  • 38
  • 121
  • 174
  • Do you mean as something like the old Multiple Document Interface format of WinForms so many child windows are bound and constrained within a master/parent window and can't be moved outside of it? – pete the pagan-gerbil Jun 12 '12 at 13:01
  • @petethepagan-gerbil almost that, yes. – Wassim AZIRAR Jun 12 '12 at 13:05
  • @petethepagan-gerbil After that I will implement a slide effect to navigate betwen them. But for this right moment I want just to display them in a master page like. – Wassim AZIRAR Jun 12 '12 at 13:06

1 Answers1

2

How about just creating a single WindowSurface control and put two overlapping grids on it. Populate the two grids with what you wanted to show on your two separate WindowSurfaces and then only show one of the grids at a time. This should give you the same functionality you're looking for.

<WindowSurface>
   <Grid> <!--So you can hold 2 grids on the same window-->
      <Grid x:Name="_grid1" Visibility="Visible"> 
          <!-- The stuff you want on window surface 1 here --> 
      </Grid>
      <Grid x:Name="_grid2" Visibility="Hidden"> 
          <!-- The stuff you want on window surface 2 here --> 
      </Grid>
   </Grid>
</WindowSurface>
Curtis
  • 5,794
  • 8
  • 50
  • 77