Link to home
Start Free TrialLog in
Avatar of ybt
ybt

asked on

C# WPF functionality

Could anybody help, I need to call a method in main window from a WPF user control and I changed this method to "static" and now for all field involved in this method I also got a message "an object reference is required for the non-static field method or property".
How can I resolve this?
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Simply by changing it back to what it was originally.  The 'static' keyword should only be used if it is really needed.  You can probably do what you want without having to make a major underlying change as to how things operate (by using static) in the background.
Avatar of ybt
ybt

ASKER

By changing it back, how can I call it from WPF user control?
SOLUTION
Avatar of AndyAinscow
AndyAinscow
Flag of Switzerland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ybt

ASKER

It makes exactly what I needed.