hi, I try to do a small wizard for creating a new address. I got an entity (EF) address that a instantiate at the beginning of the wizard:
On the first page wizard (each step are in different RadpanelItem). I got 4 textbox binded to the Adresse entity like:
The validation present in the EF metadata work well. But if a textbox can't be empty and the user do not enter any value For example he just do a tab over it), the validation do not occur because the text are not changed.
That work, but how I can detect if no validation error as been raise for let the user go to next step? For now the user change step either with validation error.
The user will click on the Next button, then forced validation occurd and if all is ok the panel change..
Any suggestion?
NouvAdresse =
new
Adresse();
On the first page wizard (each step are in different RadpanelItem). I got 4 textbox binded to the Adresse entity like:
<
TextBlock
Grid.Row
=
"0"
Grid.Column
=
"0"
Text
=
"{Binding wizAjouteAdresseRes.lblDestinataire, Source={StaticResource ResourceWrapper}}"
HorizontalAlignment
=
"Right"
VerticalAlignment
=
"Top"
></
TextBlock
>
The validation present in the EF metadata work well. But if a textbox can't be empty and the user do not enter any value For example he just do a tab over it), the validation do not occur because the text are not changed.
To avoid that I create a function called in the Click event of the button to force the validation of all the currently wizard section:
private
void
ForceValidation(Grid Container)
{
foreach
(var ctrl
in
Container.Children)
{
if
(ctrl
is
TextBox)
{
(ctrl
as
TextBox).GetBindingExpression(TextBox.TextProperty).UpdateSource();
}
}
}
That work, but how I can detect if no validation error as been raise for let the user go to next step? For now the user change step either with validation error.
The user will click on the Next button, then forced validation occurd and if all is ok the panel change..
Any suggestion?