Я получаю исключение пустого указателя на имя цели в установщике, где я устанавливаю свойство focusmanager.focuselement.Я не уверен, почему это не работает.Любая помощь будет оценена.
<Style x:Key="DesignerItemStyle" TargetType="ContentControl">
<Setter Property="MinHeight" Value="50"/>
<Setter Property="MinWidth" Value="50"/>
<Setter Property="RenderTransformOrigin" Value="0.5,0.5"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
<Grid DataContext="{Binding RelativeSource={RelativeSource TemplatedParent}}">
<s:MoveThumb Template="{StaticResource MoveThumbTemplate}" Cursor="SizeAll"/>
<Control x:Name="ResizeDecorator" Template="{StaticResource ResizeDecoratorTemplate}" Visibility="Collapsed"/>
<ContentPresenter Content="{TemplateBinding ContentControl.Content}"/>
<TextBox x:Name="textboxName" Text="node" Background="Transparent" BorderBrush="Transparent" BorderThickness="0" HorizontalAlignment="Center" VerticalAlignment="Center" Width="Auto" Height="Auto" IsHitTestVisible="False"/>
<TextBox x:Name="count" Text="100" Background="Transparent" BorderBrush="Transparent" BorderThickness="0" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="Auto" Height="Auto" IsHitTestVisible="False"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter TargetName="ResizeDecorator" Property="Visibility" Value="Visible"/>
</Trigger>
<Trigger Property="IsManipulationEnabled" Value="True">
<Setter TargetName="textboxName" Property="IsHitTestVisible" Value="True"/>
<Setter TargetName="textboxName" Property="FocusManager.FocusedElement" Value="textboxName"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>