Why wont this code work and place a glow around the mask editor?
<Window x:Class="Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="300" Width="300" xmlns:igEditors="http://infragistics.com/Editors">
<Window.Resources>
<!-- This style applies to any TextBox on the page. -->
<Style TargetType="{x:Type igEditors:XamMaskedEditor}">
<Style.Triggers>
<!-- When the TextBox gains focus such as when the cursor appears
in the TextBox, apply the OuterGlowBitmapEffect to the TextBox. -->
<Trigger Property="IsFocused" Value="True">
<Setter Property = "BitmapEffect" >
<Setter.Value>
<!-- The OuterGlow is blue, extends out 30 pixels, has the
maximum noise possible, and is 40% Opaque. -->
<OuterGlowBitmapEffect GlowColor="Orange" GlowSize="5"
/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
</Window.Resources>
<Grid>
<igEditors:XamMaskedEditor FlowDirection="LeftToRight" AllowShiftingAcrossSections="True" Mask="nnn" xmlns:igEditors="http://infragistics.com/Editors" Margin="45,82,55,116" />
<Button Margin="76,0,98,25" VerticalAlignment="Bottom" Height="37" Content="Button"/>
<TextBox Margin="45,8,47,0" VerticalAlignment="Top" Height="35" Text="TextBox" TextWrapping="Wrap"/>
</Grid>
</Window>
IsFocused is a property defined on the base UIElement class which indicates when the element itself is the logically focused element (i.e. it is the focusedelement of the containing focus scope). When the masked editor enters edit mode, focus is shifted to the sections list within so that is likely the focused element and so the IsFocused of the xamMaskedEditor itself will be false. You could tie this to when keyboard focus is within using the IsKeyboardFocusWithin. The editor also has an IsFocusWithin property, which indicates if logical focus is within the editor, but currently there is an issue where you cannot bind/trigger on that property which should be addressed in a hotfix.
Andrew I had tried all those as well. NONE of them work either.
I tried this as well and don't see it applying properly. I'll submit this for review and see about getting a case created for you for the issue.
Hi!
Even in the new 2010 Volume 1 release the problem is still there. Do you have a suggestion for a workaround?
The issue of the outerglow not showing was addressed back in May so you should be able to do this using one of the more recent hotfixes. Note the original code as listed would not work because IsFocused only checks if that element is logically focused so make sure you use IsKeyboardFocusWithin or use the IsFocusWithin. Note too that WPF 4 obsoleted BitmapEffects so if you're trying to use this in WPF 4, you won't see anything.