Solved

C# WPF functionality

Posted on 2016-08-16
6
24 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 500 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
Technology Partners: 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

On Demand Webinar: Networking for the Cloud Era

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

707 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