I open the second window in which there is a TextBox, I put a DataContext to it. How can I get the value from TextBox after closing the window?

  • Well, if you follow the rules of MVVM, then you should have everything divided (controls and everything that the user sees - View, Base and other data source - Model, and the layer between them is ViewModel.), You should not work with controls (view) from the code. Now, if you have all this correctly implemented, then when you close the window, you will have all the data in the VM layer (unless of course the object has been destroyed). Show the code, we will see what is wrong with you .. - EvgeniyZ
  • If you have both windows attached to the same VM, then there are no problems - Andrey NOP
  • @ AndreiNOP yes, I thought of tying to one VM - Mike Waters

0