tags:

views:

11

answers:

0

I am currently having an issue using the FocusBehavior.InitialFocusControl. The focus works fine with the Data Grid that is in the Content of the HCC but the button in the HeaderedContentControl.Header does not lose focus when pressed. When you click anywhere else it will lose focus but it does not follow the GlowFadeIn/GlowFadeOut that is set in its resource. Do I need to add a trigger to this specific case since I am only using the FocusBehavior.InitialFocusControl in a couple of places? If so, how?

<Border x:Name="customObjectFieldsBorder"
                DockPanel.Dock="Left"
                common:FocusBehavior.InitialFocusedControl="{Binding ElementName=customObjectFieldsDataGrid}">
            <rnc:HeaderedContentControl Tag="NoMouseOver">
                <rnc:HeaderedContentControl.Header>
                    <DockPanel Panel.ZIndex="99"
                               LastChildFill="False">
                        <TextBlock Text="{rne:MessageBase ASTR='List of Fields in '}"
                                   Style="{StaticResource CBOTextBlockHeaderStyle}"/>
                        <Button  x:Name="customObjectFieldsAddButton"
                                 Style="{StaticResource ButtonUnStyle}"
                                 Command="{Binding AddFieldCommand}"
                                 Margin="10,0,8,0"
                                 DockPanel.Dock="Right"
                                 VerticalAlignment="Center">
                           <Button.Content>
                                <StackPanel Orientation="Horizontal">
                                    <Image rn:ResourceReference.ImageName="Add16"
                                           Style="{StaticResource ButtonImage16}"/>
                                    <TextBlock x:Name="NewField"
                                               Text="{rne:MessageBase ASTR='Add New Field'}" />
                                </StackPanel>
                            </Button.Content>
                           </Button>
                    </DockPanel>
                </rnc:HeaderedContentControl.Header>