Hi Infragistics,
We have a Style for a XamNumericInput which is working well. When we attempt to apply our standard ErrorTemplate onto this Style, it doesn't seem to work.
The full style is as follows...
<Style x:Key="XamNumericInputPartNumber" TargetType="{x:Type ig:XamNumericInput}"> <Setter Property="Width" Value="50"/> <Setter Property="Margin" Value="5"/> <Setter Property="ValueTypeName" Value="Int32"/> <Setter Property="SpinButtonDisplayMode" Value="Always"/> <Setter Property="PromptChar" Value=""/> <Setter Property="Mask" Value="{}{number:1-999}"/> <Setter Property="Validation.ErrorTemplate"> <Setter.Value> <ControlTemplate> <DockPanel LastChildFill="True"> <Border Background="Blue" DockPanel.Dock="Right" Margin="5,0,0,0" Width="20" Height="20" CornerRadius="10" ToolTip="{Binding ElementName=customAdorner, Path=AdornedElement.(Validation.Errors)[0].ErrorContent}"> <TextBlock Text="!" VerticalAlignment="Center" HorizontalAlignment="Center" FontWeight="Bold" Foreground="White"/> </Border> <AdornedElementPlaceholder Name="customAdorner" VerticalAlignment="Center"> <Border BorderBrush="Blue" BorderThickness="1"/> </AdornedElementPlaceholder> </DockPanel> </ControlTemplate> </Setter.Value> </Setter> </Style>
I've attached an example of what the ErrorTemplate should look like.
Any help would be much appreciated.
Regards, ifdef
I should add...
We're not trying to validate the number that's entered as such. The mask of 1-999 takes care of that.
Post entry, we need to check that the particular number is not reserved, just before the user clicks Save. If the number is reserved, we use IDataErrorInfo to set the relevant error for that property.
Hello,
I am just checking if you got this worked out or you still require any assistance or clarification on the matter.
Thank you for your post. I have been looking into it, but it seems like that I am missing something in your scenario, so if this is still an issue for you, could you please send an isolated sample project, where the issue is reproduced, so I can investigate it further for you.
Looking forward for your reply.