Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have an application in which I will have to get at another WPF window which is open. In WinForms, I was able to use:

MainWindow main = (MainWindow)Application.OpenForms["MainWindow"];

To be able to access the the form. Now in WPF it does not exist. I have seen the other post on this site which is relevant, however it uses Application.Window which is not contained in the call. I just have :

  • Current
  • Equals
  • GetContentStream
  • GetCookie
  • GetRemoteStream
  • GetResourceStream
  • LoadComponet
  • RefrenceEquals
  • ResourceAssembly
  • SetCookie

So my question is this, is there a different version for OpenForms, or is there just a different way to go about it.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
290 views
Welcome To Ask or Share your Answers For Others

1 Answer

Try looking at: Application.Current. More specifically, Application.Current.Windows.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...