I am passing object of Window1 as reference to Window2 using this. Then I close Window1 and try to show Window1 using button click from Window2.
I am getting an error which is often possible with with any developer in wpf. Error is: Cannot set visibility or call Show, ShowDialog after a window has closed.
button click method in Window1.xaml.cs{
Window2 w2 = new Window2();
w2.w1Obj = this;
w2.show();
}
Then I close Window1.
button click method in Window2.xaml.cs{
w1Obj.testMethod();
this.w1Obj.show();
}
Here testMethod()
is executed well but when I want to show that window, it gets crashed. so I want to know what happens in memory or whatever to Window1 object when I closed that Window.? Is this memory leak.?