Enable Next button from bound property?

Wizard for WPF Forum

Posted 9 years ago by Janene McCrillis - UI Software Engineer, Wireless Seismic
Version: 9.2.0513
Avatar
I'm trying to enable the Next button on my wizard only if the current page has no errors. I have validation logic that is executing properly and setting a property, "HasNoErrors", that I've bound to the NextButtonEnabled property of the Wizard. It's not working as of yet, the button is never enabled, even though I know the property has been set to true - any help appreciated. Here what I have currently:

<wizard:Wizard x:Name="wizard"
CancelButtonClosesWindow="True"
FinishButtonClosesWindow="True"
FinishButtonVisible="True"
NextButtonEnabled="{Binding Path=HasNoErrors, UpdateSourceTrigger=PropertyChanged}">

Thanks,

Janene

Comments (3)

Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Janene,

The Next button's enabled state is driven by the WizardCommands.NextPage command. However the NextButtonEnabled property should be triggering a CommandManager.InvalidateRequerySuggested call, which would update the CanExecute of that command. To sum up, I would expect it to work.

It does work in our samples (just tested), so perhaps your binding is not taking? Maybe check out your VS output window to look for binding errors.


Actipro Software Support

Posted 9 years ago by Janene McCrillis - UI Software Engineer, Wireless Seismic
Avatar
I don't find a sample with the NextButton enabled state being set via a binding. Can you point me at it, please?

Janene
Posted 9 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Please look at the ButtonStates QuickStart.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.