Home > DeveloperSection > Forums > Buttons not accessible in Wpf Codebehind
jacob rasel
jacob rasel

Total Post:88

Points:616
Posted on    January-27-2014 3:07 AM

 C# C# 
Ratings:


 1 Reply(s)
 1405  View(s)
Rate this:

There is a function in Codebehind c# The Code is Like :

private static void ReceiveCallback(IAsyncResult ar)

{                                                                                                     

   // ...

}

In this Function i have to set the visibility of a button to true :

Runrc.IsEnabled = true;

But I get no intellisense for this button in that function, and it's giving me a error.



Pravesh Singh

Total Post:411

Points:2881
Posted on    January-27-2014 3:23 AM

Hi Jacob,

That is because the method is static. You cannot access a instance member in static method without its object reference.

private void ReceiveCallback(IAsyncResult ar)//Remove static

{

   // access your button here

}


Don't want to miss updates? Please click the below button!

Follow MindStick