Is the button IsEnabled auto-wired (WP7) ?

Sep 22, 2010 at 11:25 PM

Hi

I have a button with IsEnabled set to False. The button is disabled at design time but when I run gets enabled. 

I thought there may be a convention based wire-up going on. If not any ideas why my button gets enabled?

Cheers

Steve

 

Sep 22, 2010 at 11:29 PM

If I comment out the LoginButton method that is auto-wired to the button click then the button gets disabled properly. Looks like this auto-wiring is also enabling the button. How do I allow the button to be disabled when required?

Cheers

Steve

Coordinator
Sep 22, 2010 at 11:57 PM

Add a property called CanLoginButton and make sure that your class implements INotifyPropertyChanged. Use the property to control the enabled/disabled state.

Have a read through of these:

http://caliburnmicro.codeplex.com/wikipage?title=Basic%20Configuration,%20Actions%20and%20Conventions&referringTitle=Documentation

http://caliburnmicro.codeplex.com/wikipage?title=All%20About%20Actions&referringTitle=Documentation

Sep 23, 2010 at 12:33 AM

Thanks Rob. Worked great. I had tried binding the IsEnabled property but I guess it was being ignored in favour of the convention based wiring.

Cheers

Steve