I’m trying to toggle the visibility of link labels, but it just is not working. I’m using GoXam 1.2.2 for Silverlight and am doing the following:
- Toggle visibility off at the diagram level.
- Draw a link (link model gets created with IsLabelVisible= false)
- Toggle visibility on (this sets IsLabelVisible to true for all objects in the LinksSource collection, inside of a transaction of course)
- Link label is still not visible.
- Move one of the nodes attached to the link and the label pops into view.
Here’s my link template, with the offending Border highlighted in red:
[code]<DataTemplate x:Key="linkTemplate"> <go:LinkPanel DataContext="{Binding Data}" go:Part.SelectionElementName="Path" go:Part.SelectionAdorned="True" go:Part.Selectable="True" go:Part.LayerName="Background" Opacity="{Binding Opacity}" go:Part.Reshapable="True"> <go:Link.Route> <go:Route Routing="{Binding Data.Routing}" Curve="{Binding Data.Curve}" Corner="10" /> </go:Link.Route> <go:LinkShape go:LinkPanel.IsLinkShape="True" StrokeThickness="10" Stroke="Transparent" /> <go:LinkShape StrokeDashArray="{Binding FormatSettings.LineStyle}" go:LinkPanel.IsLinkShape="True" x:Name="Path" StrokeThickness="{Binding FormatSettings.LineThickness}" Stroke="{Binding FormatSettings.LineBrush}" /> <Polyline StrokeThickness="{Binding FormatSettings.LineThickness}" Points="8 4 0 8 2 4 0 0" go:LinkPanel.Index="-1" go:LinkPanel.Alignment="Center" go:LinkPanel.Orientation="Along" Visibility="{Binding Direction, ConverterParameter=From, Converter={StaticResource arrowheadToVisibilityConverter}}" Fill="{Binding FormatSettings.LineBrush}" /> <Polyline StrokeThickness="{Binding FormatSettings.LineThickness}" Points="0 4 8 0 6 4 8 8" go:LinkPanel.Alignment="Center" go:LinkPanel.Index="0" go:LinkPanel.Orientation="Along" Visibility="{Binding Direction, ConverterParameter=To, Converter={StaticResource arrowheadToVisibilityConverter}}" Fill="{Binding FormatSettings.LineBrush}" /> <Border go:LinkPanel.Orientation="None" Background="White" CornerRadius="3" BorderThickness="1" BorderBrush="Gray" Visibility="{Binding IsLabelVisible, Converter={StaticResource BoolToVisibilityConverter}}"> <Border.Effect> <DropShadowEffect BlurRadius="5" Direction="-45" Opacity="0.5" ShadowDepth="3" Color="Gray" /> </Border.Effect> <Grid> <Border Visibility="{Binding Name, Converter={StaticResource stringToVisibilityConverter}}" Background="{Binding FormatSettings.LabelBackground}"> <TextBlock go:Part.TextEditable="True" Text="{Binding Name, Mode=TwoWay}" TextWrapping="Wrap" TextAlignment="Center" Margin="5" Foreground="{Binding FormatSettings.LabelForeground}" FontSize="{Binding FormatSettings.LabelFontSize}" FontWeight="{Binding FormatSettings.IsLabelBold, Converter={StaticResource boolToFontWeightConverter}}" FontStyle="{Binding FormatSettings.IsLabelItalics, Converter={StaticResource boolToFontStyleConverter}}" TextDecorations="{Binding FormatSettings.IsLabelUnderline, Converter={StaticResource boolToTextDecorationConverter}}" /> </Border> <Border Visibility="{Binding Name, ConverterParameter=invert, Converter={StaticResource stringToVisibilityConverter}}"> <TextBlock go:Part.TextEditable="True" Style="{StaticResource NoInfoTextBlock}" Margin="5" Text="{Binding NoInfoName, Mode=TwoWay}" /> </Border> </Grid> </Border> </go:LinkPanel> </DataTemplate>[/code]