Jump to content

Edit source on frame WPF from code behind

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
nick3

nick3

    Newbie

  • Members
  • PipPip
  • 29 posts
Hey,
Just started using WPF and got a fast question about frames, I have a frame that i want to connect to a page (ShowGame), if i just go into the xaml and type Source="...\\ShowGame.xaml" it works great, I get the page up and showing, but now I wanna do this from the code behind (switch pages), and it wont work, i tried:
frame1.Source = new Uri("...\\ShowGame.xaml", UriKind.RelativeOrAbsolute);

Also tried to change UriKind, but doesnt matter. It just crashes as soon as i try to use the page. I even tried to put in the whole path, but that didnt even make it work.

Please help me with this.
/Nick

#2
dot_developer

dot_developer

    Newbie

  • Members
  • PipPip
  • 14 posts
Use the Frame.Navigate method.