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?
How can I resolve this?
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.
ASKER
By changing it back, how can I call it from WPF user control?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
You need to use events to communicate
Also look at
https://msdn.microsoft.com/en-us/library/ff725477(v=expression.40).aspx
Also look at
https://msdn.microsoft.com/en-us/library/ff725477(v=expression.40).aspx
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
It makes exactly what I needed.