Hallo,
I updated to version 4.2.0.9.172 Runtime 4.0.30319. From that point on I receive this error coming from my VerticalLineAnnotationStyle:
System.InvalidOperationException: ‘Unable to Apply the Control Template. PART_LabelsPanel is missing or of the wrong type’
So I added this to the template in my style:
And now I get this error: System.ArgumentOutOfRangeException: ‘Specified argument was out of the range of valid values.’
What should the Template of VerticalLineAnnotation be?
My current syle:
<Style x:Key="CommentAnnotationStyle" TargetType="pp:CustomCommentAnnotation">
<Setter Property="IsTabStop" Value="False" />
<Setter Property="StrokeThickness" Value="1.0" />
<Setter Property="LabelTextFormatting" Value="{Binding DefaultTextFormatting, Mode=OneWay, RelativeSource={RelativeSource Self}}" />
<Setter Property="IsHitTestVisible" Value="True"/>
<Setter Property="Stroke" Value="Blue"/>
<Setter Property="StrokeDashArray" Value="1 0 0 1"/>
<!---->
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="s:VerticalLineAnnotation">
<Grid x:Name="PART_LineAnnotationRoot" ShowGridLines="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Line x:Name="PART_GhostLine"
MouseDown="PART_GhostLine_MouseDown"
Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Center"
Stretch="Fill"
Stroke="Transparent"
StrokeThickness="8"
IsHitTestVisible="True"
Cursor="Hand"
ToolTip="{Binding Comment, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type pp:CustomCommentAnnotation}}}"
X1="0"
X2="0"
Y1="0"
Y2="1" /><!-- after Transparent StrokeThickness="{z:Static Member=visuals:ManipulationMargins.AnnotationLineWidth}"-->
<Line x:Name="PART_Line"
MouseDown="PART_GhostLine_MouseDown"
Grid.Row="1"
Grid.Column="1"
HorizontalAlignment="Center"
Stretch="Fill"
Stroke="{TemplateBinding Stroke}"
StrokeDashArray="{TemplateBinding StrokeDashArray}"
StrokeEndLineCap="Square"
StrokeStartLineCap="Square"
StrokeThickness="{TemplateBinding StrokeThickness}"
IsHitTestVisible="True"
Visibility="{Binding LineVisible, Converter={StaticResource BoolToVis},
RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type my:STMainWindow}}}"
Cursor="Hand"
X1="0"
X2="0"
Y1="0"
Y2="1" />
<Grid x:Name="PART_LabelsPanel"/>
<Label></Label>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
Regards,
Jason
- bochelie asked 5 years ago
- last active 5 years ago