Reuse WPF window in PS

Welcome Forums General PowerShell Q&A Reuse WPF window in PS

This topic contains 1 reply, has 2 voices, and was last updated by

2 years, 1 month ago.

  • Author
  • #62668

    Points: 0
    Rank: Member

    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.


  • #62755

    Points: 1,811
    Helping HandTeam Member
    Rank: Community Hero

    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.

The topic ‘Reuse WPF window in PS’ is closed to new replies.

denizli escort samsun escort muğla escort ataşehir escort kuşadası escort