Let say I have are two WPF forms: Form1 and Form2. Form1 contains a button which should show a message “True” if the constructor of the second form has been called. How can I implement this?
Let say I have are two WPF forms: Form1 and Form2 . Form1 contains
Share
Vague question … to chek if FormXs constructor got called, from inside another class:
Have a static bool (IsConstructed) in the FormX class that is set to true in the constructor ,and then check through FormX.IsConstructed .
In the case of having access to a reference of the form you could just do
If you want to be notified, consider raising and event ( if a reference is possible) or a command.
A lot of this might depend on your application set up …