?
Solved

C# WPF functionality

Posted on 2016-08-16
6
Medium Priority
?
25 Views
Last Modified: 2016-08-24
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?
0
Comment
Question by:ybt
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 44

Expert Comment

by:AndyAinscow
ID: 41757973
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.
0
 

Author Comment

by:ybt
ID: 41757995
By changing it back, how can I call it from WPF user control?
0
 
LVL 44

Assisted Solution

by:AndyAinscow
AndyAinscow earned 2000 total points
ID: 41758999
Have a look at the following.  I think it will supply all the information you need.
http://stackoverflow.com/questions/25020916/interaction-between-two-usercontrols-in-wpf-without-using-mvvm
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 44

Expert Comment

by:AndyAinscow
ID: 41759001
You need to use events to communicate
Also look at
https://msdn.microsoft.com/en-us/library/ff725477(v=expression.40).aspx
0
 

Accepted Solution

by:
ybt earned 0 total points
ID: 41762529
0
 

Author Closing Comment

by:ybt
ID: 41768454
It makes exactly what I needed.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question