I have a user control bound to appropriate ViewModel. I have a GraphLayout (using Graph#) on this control bound to ViewModel.Graph property:
<graph:ProductGraphLayout Graph="{Binding Path=Graph}" />
A number of VertexControl containing ProductVertex are placed on this layout. Content is represented by DataTemplate and theming applied using Style:
<DataTemplate x:Key="VertexTemplate" DataType="{x:Type graph:ProductVertex}">
<TextBlock Text="{Binding Path=ID, Mode=OneWay}" />
</DataTemplate>
<Style TargetType="{x:Type graphsharp:VertexControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type graphsharp:VertexControl}">
<Border>
<Border.Style>
<Style TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="#6695C4" />
<Setter Property="BorderThickness" Value="2" />
</Style>
</Border.Style>
<ContentPresenter Content="{TemplateBinding Vertex}" ContentTemplate="{StaticResource VertexTemplate}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
How can I change a style of the container (VertexControl) based on ProductVertex properties, say IsCurrent?
Seems that I’ve managed by myself how to achieve that: