I have a textbox and is bound to a property.
public SapLanguage Language
{
get { return _language; }
set
{
_language = value;
RaisePropertyChanged();
}
}
The SapLanguage is type enum:
public enum SapLanguage
{
DE,
EN,
FR,
IT
}
The WPF looks like as follow:
<TextBox Grid.Row="3" Grid.Column="1" Margin="10,10,10,10" FontSize="26" FontWeight="Bold"
CharacterCasing="Upper"
HorizontalAlignment="Left" VerticalContentAlignment="Center" MaxLength="2" Width="60"
HorizontalContentAlignment="Center" Text="{Binding Language, StringFormat={} }">
</TextBox>
When I type a value in the textbox, that does not exist. It shows me an error:
How can I store the error message into a variable?