Buttons not accessible in Wpf Codebehind

Total Post:88


 2249  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.

  1. Re: Buttons not accessible in Wpf Codebehind

    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

      Modified On Apr-04-2018 02:03:23 AM


Please check, If you want to make this post sponsored

You are not a Sponsored Member. Click Here to Subscribe the Membership.