How to call method of the main WPF window from the modal window?
(In fact I want to start some timer of the MainWindow.xaml.cs when I close some model window.)
Thank you!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
What you can do is before opening your second window assign the main window as its owner, then from the modal window call the Owner property, cast it into a MainWindow object and you’ll be able to execute the method.