29

Can we access the current System.Windows.Application object inside a Window class in WPF ?

2 Answers 2

45

Yes sure. You can access it everywhere in a WPF application.

// assuming that you derivate of Application is named App
((App)Application.Current).SomePropertyOfApp = ...
Sign up to request clarification or add additional context in comments.

Comments

11

Yes - it's as easy as Application.Current.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.