wpf - c# double screen app, how to change frame of the mainwindow from second window? -


I have an app that works in two screens, the second screen is a setting panel, from the settings panel to me in the main window Frame content must be refreshed. I am using this code:

  main window winprost = new menu-window (); Var PrimaryScreen = System. Windowsforms Screen. All scans. Where (s = & gt; s primary). FirstOver Default (); If (primaryscreen! = Null) {winFirst._mainFrame.Source = New Uri ("DynamicSource.xaml", UriKind.Relative); winFirst.Show (); }   

With this code I need to press a button in the second window which can load in the main window. But every time I launch it, this code loads a new main window class ... I think this is not the best way, maybe I will have to face some memory related problem. So if this is a problematic approach how can I use the frame of the current main window and change it without any change?

  Application curApp = application.Current; Window main window = break Manwindo;   

I have also tried this code but in this way I can not get in main_frame element

The main window can always be used by the application.Current, but return it as a window has come. However, when you know what this should be, you will insert it:

  var mainWin = Application.Current.MainWindow MainWindow; Debug Asset (Main Wine! = Null); // work with sanit check / main wine    

Comments

Popular posts from this blog

Pass DB Connection parameters to a Kettle a.k.a PDI table Input step dynamically from Excel -

multithreading - PhantomJS-Node in a for Loop -

c++ - MATLAB .m file to .mex file using Matlab Compiler -