Hi everyone! I'm relatively new to all of this, but just got super lost trying to do this one thing, so hopefully someone will be able to tell what I'm doing wrong.
Basically for the setup of my project, I have 2 page files in a WPF project. The "main" project has a frame in it that calls the second page by
Essentially what I need to do, is be able to access non static methods I have stored in the MainWindow.xmal.cs and the SecondPage.xaml.cs, but it seems like virtually every way I try to go about it, I end up with a error "an object reference is required for the non-static field, method or property.
I've tried just creating a new instance of SecondPage before every reference, but it seems like a clunky way to do it, and also doesn't solve my problem, because in the methods I have I need to access the specific SecondPage Instance so that it changes for the viewer and I can get that instances specific values.
I apologize if this is a little confusing but thanks so much for any help!
Feel free to suggest a better way to go about this multipage thing if that would solve the problem as well.
Basically for the setup of my project, I have 2 page files in a WPF project. The "main" project has a frame in it that calls the second page by
calling second page:
SecondPage secondPage = new SecondPage();
viewingFrame.Content = secondPage;
I've tried just creating a new instance of SecondPage before every reference, but it seems like a clunky way to do it, and also doesn't solve my problem, because in the methods I have I need to access the specific SecondPage Instance so that it changes for the viewer and I can get that instances specific values.
I apologize if this is a little confusing but thanks so much for any help!
Feel free to suggest a better way to go about this multipage thing if that would solve the problem as well.