I've created a Wizard
using the Extended WPF Toolkit by Xceed and need to set the IsDefault
property of the Next button to true
(Clicks button when Enter is pressed).
We have a user credentials page where clicking the Next button validates the credentials and performs other actions. I'd like the the page to behave like people would expect, type in credentials and press Enter to continue. Looking through the documentation, the only button properties that seem to be exposed for the built-in buttons are Visibility
and Content
.
I can't figure out how to access all the other available properties for the Button Class on those built-in Wizard Buttons.
The
Wizard
control does not expose any property to set the default button. However, you can copy the default style from GitHub and adapt it like below. I set theIsDefault
property for Next and Finish.Copy this style to any parent resource dictionary. As it is and implicit style, it will be applied automatically to all
Wizard
s in scope. You can alternatively add anx:Key
and reference it explicitly.If you need a more flexible approach, you will have to create a custom control derived from
Wizard
that exposes a dependency property, e.g. of an enum type for the button, to be able to specify the default button. You could then get the template parts (the buttons) in the control and set theirIsDefault
property accordingly in the property changed callback of the dependency property.