Reuse WPF window in PS

This topic contains 1 reply, has 2 voices, and was last updated by  Don Jones 8 months, 3 weeks ago.

  • Author
    Posts
  • #62668

    vacano
    Participant

    Hi!
    I have a main window that has a button. When the button is click, it will open another wpf window called w2. If I close w2, the next time I click the button I get an error message basically saying that the window was closed and cannot be reused.

    How can I make sure that a new wpf window is created everytime the button is clicked?
    Note: I am using visual studio to create the window.

    Thanks

  • #62755

    Don Jones
    Keymaster

    Without seeing code (and please use a Gist versus posting a huge chunk), it's hard to tell. But essnetially you must create a brand new instance from scratch, rather than reusing a prior reference.

You must be logged in to reply to this topic.