Is there a way to access wpf ui elements from a static method? I'm trying to access a textbox string from a static method to no avail
2 Answers
This would be impossible. Your static method can run while the textbox doesn't exist because there is no instance of your form.
Static methods are designed to be able to run without any instance.
Quote from wikipedia:
Therefore, a static method cannot refer to a specific instance of the class (i.e. it cannot refer to this, self, Me, etc.)
2 Comments
Ash Burlaczenko
Use
<blockquote> to display quotes.slugster
That Wiki quote doesn't apply in this case - it is referring to a static method trying to refer to the "instance" of the class it is in.