When I apply this style to XamMaskedEditor I can not see the field valueif within the focus of the field I can see the value but lose the stylethere is someone that I can 'help
<Window x:Class="MainWindow" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="MainWindow" Height="350" Width="525" xmlns:igEditors="http://infragistics.com/Editors"> <Window.Resources >
<Style x:Key="roundTextBox" TargetType="{x:Type igEditors:XamMaskedEditor }">
<Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type igEditors:XamMaskedEditor }"> <Grid> <Border x:Name="BorderBase" Background="White" BorderThickness="1.4,1.4,1,1" BorderBrush="Silver" CornerRadius="10" /> <Label x:Name="TextPrompt" Content="{TemplateBinding Tag}" Visibility="Collapsed" Focusable="False" Foreground="Silver"></Label> </Grid> <ControlTemplate.Triggers> <MultiTrigger> <MultiTrigger.Conditions> <Condition Property="IsFocused" Value="False"></Condition> <Condition Property="Text" Value=""></Condition> </MultiTrigger.Conditions> <MultiTrigger.Setters> <Setter Property="Visibility" TargetName="TextPrompt" Value="Visible"></Setter> </MultiTrigger.Setters> </MultiTrigger> <Trigger Property="IsFocused" Value="True"> <Setter Property="BorderThickness" TargetName="BorderBase" Value="2.4,2.4,1,1"></Setter> </Trigger> <Trigger Property="IsEnabled" Value="False"> <Setter Property="Foreground" Value="DimGray" /> </Trigger> </ControlTemplate.Triggers> </ControlTemplate> </Setter.Value> </Setter> </Style> </Window.Resources> <Grid> <TextBox Height="29" HorizontalAlignment="Left" Margin="91,91,0,0" Name="TextBox1" VerticalAlignment="Top" Width="113" Text="ciao" AcceptsReturn="True" /> <igEditors:XamMaskedEditor Height="24" HorizontalAlignment="Left" Margin="73,157,0,0" Name="XamMaskedEditor1" VerticalAlignment="Top" Width="163" Value="TEST WPF" UseLayoutRounding="False" Style="{StaticResource roundTextBox}" IsHitTestVisible="True" SnapsToDevicePixels="True" /> </Grid></Window>
I was wondering if you have managed to sort this issue out. Let us know if you need further assistance.
In your case you are binding the Content of the Label to the Tag property of the XamMaskedEditor which is not set. You can either set Tag to the masked editor or better bind the Content to the DisplayText property of the editor:
<
Label x:Name="TextBlock" Content="{TemplateBinding DisplayText}" Visibility="Collapsed" Focusable="False" Foreground="Silver"/>
Let me know if that solves the issue.