Application with multiple WPF forms

  • Thread starter Thread starter Andy
  • Start date Start date
A

Andy

I am trying to create an application with multiple wpf forms. What I would
like is a main menu type form with a button - "Load Other Screen".

What would the code be for the Click Event. I have tried
LoadOtherScreen win = new LoadOtherScreen();
win.show();

But in WPF SHOW is not valid

I did this.Conent = win; which worked, however in the other screen, I
couldn't get back to the main screen. The same code gave me an error about
not being part of a child...

Is this possible? Or am I missing the whole idea of WPF?

Thanks
 
Hi Andy...

I am having the same problem but have a partial solution for you...

use a wrappanel, have a navigation procedure that assigns that new
usercontrol to the wrop panel.... i.e.


XAML
<WrapPanel x:Name="mainPanel" Margin="0,47,0,12" Grid.RowSpan="2">

</WrapPanel>

Code:
public void Navigate(UserControl NextPage)
{
mainPanel.Children.Clear();
mainPanel.Children.Add(NextPage);
//this.Content = NextPage;
}

the wrappanel is housed in the main usercontrol with all the menus that take
you to different pages...

there is a problem thou with size issues that I am still trying to get
around, will let you know if I get a better way
 
Back
Top