Hi Walter,
yes, I really want to have two different link templates for the temporary link. In my application, we have normal transitions that are drawn with a normal arrow and a timemonitoring Transition that is drawn with a dashed line and a stopwatch Image. According to the Transition the user creates the according template and also during drawing, the according temporary template should be used.
The first proposal doesn’t work. Just tried it out.
What exactly do you mean by modifying the TemporaryLink? What properties can I set there to make them use a specific template?
Your third proposal is beyond my current knowledge level. Have to dig into this to understand what you mean ;)
Currently, I’m trying another approach and want to get along with only one template and show/hide some of its content depending on the tag property of the temporary link object which I set in my linking tool. BUT this also doesn’t work. It seems my data binding might be wrong.
Perhaps you can have a look into this? I simplified the template a bit and currently only want to bind the TemporaryLink.Tag to a text block’s text (see below).
I tried following path expressions without success: “Tag”, “Data.Tag”, “Link.Tag”
Any ideas?
Thanks in advance,
Marc
<DataTemplate x:Key="TemporaryTimemonitoringLink">
<go:LinkPanel go:Part.SelectionElementName="Path"
go:Part.Reshapable="False">
<go:Link.Route>
<go:Route Routing="Normal"/>
</go:Link.Route>
<go:LinkShape x:Name="Path"
go:LinkPanel.IsLinkShape="True"
Stroke="{x:Static SystemColors.HighlightBrush}"
StrokeThickness="1"
StrokeDashArray="4.0 2.0"/>
<Path Fill="{x:Static SystemColors.HighlightBrush}" go:LinkPanel.ToArrow="Standard" go:LinkPanel.Index="-1"/>
<go:NodePanel Sizing="Auto"
Background="{Binding RelativeSource={RelativeSource AncestorType=go:Diagram}, Path=Background}">
<TextBlock Text="{Binding Path=Link.Tag}"/>
</go:NodePanel>
</go:LinkPanel>
</DataTemplate>