Suppose that I have a registration screen, and when the user clicks the “Register” button an asynchronous operation takes place, at the end of which a delegate method is invoked. I want the button to be turned off when the user clicks it (that part is easy), and for the button to be re-enabled if the registration fails (server declined the registration). How do I access this button’s properties from the delegate function?
Share
Assuming you’ve declared the Button’s name in XAML, in the delegate callback function, I’d do something like (The Dispatcher.BeginInvoke is necessary to execute the code on the UI thread):