Browse Source
git-svn-id: svn://svn.sharpdevelop.net/sharpdevelop/trunk@6261 1ccf3a8d-04fe-1044-b7c0-cef0b8235c61pull/1/head
6 changed files with 508 additions and 613 deletions
@ -1,290 +1,163 @@ |
|||||||
<ResourceDictionary |
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
xmlns:Controls="clr-namespace:ICSharpCode.CodeQualityAnalysis.Controls" |
||||||
xmlns:GraphSharp_Controls="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls" |
xmlns:GraphSharp_Controls="clr-namespace:GraphSharp.Controls;assembly=GraphSharp.Controls" |
||||||
xmlns:Converters="clr-namespace:GraphSharp.Converters;assembly=GraphSharp.Controls" |
xmlns:Converters="clr-namespace:GraphSharp.Converters;assembly=GraphSharp.Controls" |
||||||
xmlns:WPFExtensions_AttachedBehaviours="clr-namespace:WPFExtensions.AttachedBehaviours;assembly=WPFExtensions"> |
xmlns:WPFExtensions_AttachedBehaviours="clr-namespace:WPFExtensions.AttachedBehaviours;assembly=WPFExtensions" |
||||||
|
> |
||||||
|
<Converters:EdgeRouteToPathConverter x:Key="routeToPathConverter" /> |
||||||
|
<Controls:DependencyIconVertexConverter x:Key="IconConverter"/> |
||||||
|
|
||||||
<Converters:EdgeRouteToPathConverter x:Key="routeToPathConverter" /> |
<SolidColorBrush x:Key="HighlightedVertexBorderBrush" Color="Transparent" /> |
||||||
|
<SolidColorBrush x:Key="HighlightedVertexBackgroundBrush" Color="{DynamicResource {x:Static SystemColors.HighlightColorKey}}" /> |
||||||
|
<SolidColorBrush x:Key="HighlightedVertexForegroundBrush" Color="{DynamicResource {x:Static SystemColors.ControlLightLightColorKey}}" /> |
||||||
|
<SolidColorBrush x:Key="SemiHighlightedSourceVertexBorderBrush" Color="Transparent" /> |
||||||
|
<SolidColorBrush x:Key="SemiHighlightedSourceVertexBackgroundBrush" Color="#FF1DBA00" /> |
||||||
|
<SolidColorBrush x:Key="SemiHighlightedTargetVertexBorderBrush" Color="Transparent" /> |
||||||
|
<SolidColorBrush x:Key="SemiHighlightedTargetVertexBackgroundBrush" Color="#FFD6A51C" /> |
||||||
|
<SolidColorBrush x:Key="HighlightedEdgeBrush" Color="{DynamicResource {x:Static SystemColors.HighlightColorKey}}" /> |
||||||
|
<SolidColorBrush x:Key="SemiHighlightedInEdgeBrush" Color="#FF1DBA00" /> |
||||||
|
<SolidColorBrush x:Key="SemiHighlightedOutEdgeBrush" Color="#FFD6A51C" /> |
||||||
|
|
||||||
<SolidColorBrush x:Key="HighlightedVertexBorderBrush" Color="Transparent" /> |
<!-- VERTEX CONTROL --> |
||||||
<SolidColorBrush x:Key="HighlightedVertexBackgroundBrush" Color="{DynamicResource {x:Static SystemColors.HighlightColorKey}}" /> |
<Style TargetType="{x:Type GraphSharp_Controls:VertexControl}"> |
||||||
<SolidColorBrush x:Key="HighlightedVertexForegroundBrush" Color="{DynamicResource {x:Static SystemColors.ControlLightLightColorKey}}" /> |
<Setter Property="Template"> |
||||||
<SolidColorBrush x:Key="SemiHighlightedSourceVertexBorderBrush" Color="Transparent" /> |
<Setter.Value> |
||||||
<SolidColorBrush x:Key="SemiHighlightedSourceVertexBackgroundBrush" Color="#FF1DBA00" /> |
<ControlTemplate TargetType="{x:Type GraphSharp_Controls:VertexControl}"> |
||||||
<SolidColorBrush x:Key="SemiHighlightedTargetVertexBorderBrush" Color="Transparent" /> |
<Border Background="{TemplateBinding Background}" |
||||||
<SolidColorBrush x:Key="SemiHighlightedTargetVertexBackgroundBrush" Color="#FFD6A51C" /> |
BorderBrush="{TemplateBinding BorderBrush}" |
||||||
<SolidColorBrush x:Key="HighlightedEdgeBrush" Color="{DynamicResource {x:Static SystemColors.HighlightColorKey}}" /> |
BorderThickness="{TemplateBinding BorderThickness}" |
||||||
<SolidColorBrush x:Key="SemiHighlightedInEdgeBrush" Color="#FF1DBA00" /> |
CornerRadius="10,10,10,10" |
||||||
<SolidColorBrush x:Key="SemiHighlightedOutEdgeBrush" Color="#FFD6A51C" /> |
Padding="{TemplateBinding Padding}"> |
||||||
|
<StackPanel Orientation="Horizontal"> |
||||||
|
<Image Margin="0, 1, 5, 0" Source="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type GraphSharp_Controls:VertexControl}}, Path=Vertex, Converter={StaticResource IconConverter}}" /> |
||||||
|
<ContentPresenter Content="{TemplateBinding Vertex}"/> |
||||||
|
</StackPanel> |
||||||
|
</Border> |
||||||
|
</ControlTemplate> |
||||||
|
</Setter.Value> |
||||||
|
</Setter> |
||||||
|
<Setter Property="GraphSharp_Controls:GraphElementBehaviour.HighlightTrigger" Value="{Binding Path=IsMouseOver, RelativeSource={RelativeSource Self}}"/> |
||||||
|
<Setter Property="WPFExtensions_AttachedBehaviours:DragBehaviour.IsDragEnabled" Value="True"/> |
||||||
|
<Setter Property="WPFExtensions_AttachedBehaviours:DragBehaviour.X" Value="{Binding Path=(GraphSharp_Controls:GraphCanvas.X), Mode=TwoWay, RelativeSource={RelativeSource Self}}"/> |
||||||
|
<Setter Property="WPFExtensions_AttachedBehaviours:DragBehaviour.Y" Value="{Binding Path=(GraphSharp_Controls:GraphCanvas.Y), Mode=TwoWay, RelativeSource={RelativeSource Self}}"/> |
||||||
|
<Setter Property="Background" Value="#FFE3E3E3"/> |
||||||
|
<Setter Property="BorderThickness" Value="5,3,5,3"/> |
||||||
|
<Setter Property="Padding" Value="10,5,10,5"/> |
||||||
|
<Setter Property="BorderBrush" Value="#FF393939"/> |
||||||
|
<Style.Triggers> |
||||||
|
<Trigger Property="GraphSharp_Controls:GraphElementBehaviour.IsHighlighted" Value="True"> |
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource HighlightedVertexBorderBrush}"/> |
||||||
|
<Setter Property="Background" Value="{StaticResource HighlightedVertexBackgroundBrush}"/> |
||||||
|
<Setter Property="Foreground" Value="{StaticResource HighlightedVertexForegroundBrush}"/> |
||||||
|
</Trigger> |
||||||
|
<Trigger Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" Value="True"> |
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource HighlightedVertexBorderBrush}"/> |
||||||
|
<Setter Property="Background" Value="{StaticResource HighlightedVertexBackgroundBrush}"/> |
||||||
|
<Setter Property="Foreground" Value="{StaticResource HighlightedVertexForegroundBrush}"/> |
||||||
|
</Trigger> |
||||||
|
<MultiTrigger> |
||||||
|
<MultiTrigger.Conditions> |
||||||
|
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" Value="True"/> |
||||||
|
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.SemiHighlightInfo" Value="Source"/> |
||||||
|
</MultiTrigger.Conditions> |
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource SemiHighlightedSourceVertexBorderBrush}"/> |
||||||
|
<Setter Property="Background" Value="{StaticResource SemiHighlightedSourceVertexBackgroundBrush}"/> |
||||||
|
</MultiTrigger> |
||||||
|
<MultiTrigger> |
||||||
|
<MultiTrigger.Conditions> |
||||||
|
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" Value="True"/> |
||||||
|
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.SemiHighlightInfo" Value="Target"/> |
||||||
|
</MultiTrigger.Conditions> |
||||||
|
<Setter Property="BorderBrush" Value="{StaticResource SemiHighlightedTargetVertexBorderBrush}"/> |
||||||
|
<Setter Property="Background" Value="{StaticResource SemiHighlightedTargetVertexBackgroundBrush}"/> |
||||||
|
</MultiTrigger> |
||||||
|
</Style.Triggers> |
||||||
|
</Style> |
||||||
|
|
||||||
<!-- VERTEX CONTROL --> |
<!-- EDGE CONTROL --> |
||||||
<Style TargetType="{x:Type GraphSharp_Controls:VertexControl}"> |
<Style TargetType="{x:Type GraphSharp_Controls:EdgeControl}"> |
||||||
<Setter Property="Template"> |
<Setter Property="Template"> |
||||||
<Setter.Value> |
<Setter.Value> |
||||||
<ControlTemplate TargetType="{x:Type GraphSharp_Controls:VertexControl}"> |
<ControlTemplate TargetType="{x:Type GraphSharp_Controls:EdgeControl}"> |
||||||
<Border Background="{TemplateBinding Background}" |
<Path Stroke="{TemplateBinding Foreground}" |
||||||
BorderBrush="{TemplateBinding BorderBrush}" |
MinWidth="1" |
||||||
BorderThickness="{TemplateBinding BorderThickness}" |
MinHeight="1" |
||||||
CornerRadius="10,10,10,10" |
ToolTip="{TemplateBinding ToolTip}" |
||||||
Padding="{TemplateBinding Padding}"> |
x:Name="edgePath"> |
||||||
<ContentPresenter Content="{TemplateBinding Vertex}"/> |
<Path.Data> |
||||||
</Border> |
<PathGeometry> |
||||||
</ControlTemplate> |
<PathGeometry.Figures> |
||||||
</Setter.Value> |
<MultiBinding Converter="{StaticResource routeToPathConverter}"> |
||||||
</Setter> |
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
||||||
<Setter Property="GraphSharp_Controls:GraphElementBehaviour.HighlightTrigger" Value="{Binding Path=IsMouseOver, RelativeSource={RelativeSource Self}}"/> |
Path="Source.(GraphSharp_Controls:GraphCanvas.X)" /> |
||||||
<Setter Property="WPFExtensions_AttachedBehaviours:DragBehaviour.IsDragEnabled" Value="True"/> |
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
||||||
<Setter Property="WPFExtensions_AttachedBehaviours:DragBehaviour.X" Value="{Binding Path=(GraphSharp_Controls:GraphCanvas.X), Mode=TwoWay, RelativeSource={RelativeSource Self}}"/> |
Path="Source.(GraphSharp_Controls:GraphCanvas.Y)" /> |
||||||
<Setter Property="WPFExtensions_AttachedBehaviours:DragBehaviour.Y" Value="{Binding Path=(GraphSharp_Controls:GraphCanvas.Y), Mode=TwoWay, RelativeSource={RelativeSource Self}}"/> |
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
||||||
<Setter Property="Background" Value="#FFE3E3E3"/> |
Path="Source.ActualWidth" /> |
||||||
<Setter Property="BorderThickness" Value="5,3,5,3"/> |
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
||||||
<Setter Property="Padding" Value="10,5,10,5"/> |
Path="Source.ActualHeight" /> |
||||||
<Setter Property="BorderBrush" Value="#FF393939"/> |
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
||||||
<Style.Triggers> |
Path="Target.(GraphSharp_Controls:GraphCanvas.X)" /> |
||||||
<Trigger Property="GraphSharp_Controls:GraphElementBehaviour.IsHighlighted" Value="True"> |
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
||||||
<Setter Property="BorderBrush" Value="{StaticResource HighlightedVertexBorderBrush}"/> |
Path="Target.(GraphSharp_Controls:GraphCanvas.Y)" /> |
||||||
<Setter Property="Background" Value="{StaticResource HighlightedVertexBackgroundBrush}"/> |
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
||||||
<Setter Property="Foreground" Value="{StaticResource HighlightedVertexForegroundBrush}"/> |
Path="Target.ActualWidth" /> |
||||||
</Trigger> |
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
||||||
<Trigger Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" Value="True"> |
Path="Target.ActualHeight" /> |
||||||
<Setter Property="BorderBrush" Value="{StaticResource HighlightedVertexBorderBrush}"/> |
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
||||||
<Setter Property="Background" Value="{StaticResource HighlightedVertexBackgroundBrush}"/> |
Path="RoutePoints" /> |
||||||
<Setter Property="Foreground" Value="{StaticResource HighlightedVertexForegroundBrush}"/> |
</MultiBinding> |
||||||
</Trigger> |
</PathGeometry.Figures> |
||||||
<MultiTrigger> |
</PathGeometry> |
||||||
<MultiTrigger.Conditions> |
</Path.Data> |
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" Value="True"/> |
</Path> |
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.SemiHighlightInfo" Value="Source"/> |
</ControlTemplate> |
||||||
</MultiTrigger.Conditions> |
</Setter.Value> |
||||||
<Setter Property="BorderBrush" Value="{StaticResource SemiHighlightedSourceVertexBorderBrush}"/> |
</Setter> |
||||||
<Setter Property="Background" Value="{StaticResource SemiHighlightedSourceVertexBackgroundBrush}"/> |
<Setter Property="GraphSharp_Controls:GraphElementBehaviour.HighlightTrigger" |
||||||
</MultiTrigger> |
Value="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}" /> |
||||||
<MultiTrigger> |
<Setter Property="MinWidth" |
||||||
<MultiTrigger.Conditions> |
Value="1" /> |
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" Value="True"/> |
<Setter Property="MinHeight" |
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.SemiHighlightInfo" Value="Target"/> |
Value="1" /> |
||||||
</MultiTrigger.Conditions> |
<Setter Property="Background" |
||||||
<Setter Property="BorderBrush" Value="{StaticResource SemiHighlightedTargetVertexBorderBrush}"/> |
Value="Red" /> |
||||||
<Setter Property="Background" Value="{StaticResource SemiHighlightedTargetVertexBackgroundBrush}"/> |
<Setter Property="Foreground" |
||||||
</MultiTrigger> |
Value="Silver" /> |
||||||
</Style.Triggers> |
<Setter Property="Opacity" |
||||||
</Style> |
Value="0.5" /> |
||||||
|
<Style.Triggers> |
||||||
<!-- EDGE CONTROL --> |
<Trigger Property="GraphSharp_Controls:GraphElementBehaviour.IsHighlighted" |
||||||
<Style TargetType="{x:Type GraphSharp_Controls:EdgeControl}"> |
Value="True"> |
||||||
<Setter Property="Template"> |
<Setter Property="Foreground" |
||||||
<Setter.Value> |
Value="{DynamicResource HighlightedEdgeBrush}" /> |
||||||
<ControlTemplate TargetType="{x:Type GraphSharp_Controls:EdgeControl}"> |
</Trigger> |
||||||
<Path Stroke="{TemplateBinding Foreground}" |
<Trigger Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" |
||||||
MinWidth="1" |
Value="True"> |
||||||
MinHeight="1" |
<Setter Property="Foreground" |
||||||
ToolTip="{TemplateBinding ToolTip}" |
Value="{DynamicResource HighlightedEdgeBrush}" /> |
||||||
x:Name="edgePath"> |
</Trigger> |
||||||
<Path.Data> |
<MultiTrigger> |
||||||
<PathGeometry> |
<MultiTrigger.Conditions> |
||||||
<PathGeometry.Figures> |
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" |
||||||
<MultiBinding Converter="{StaticResource routeToPathConverter}"> |
Value="True" /> |
||||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.SemiHighlightInfo" |
||||||
Path="Source.(GraphSharp_Controls:GraphCanvas.X)" /> |
Value="InEdge" /> |
||||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
</MultiTrigger.Conditions> |
||||||
Path="Source.(GraphSharp_Controls:GraphCanvas.Y)" /> |
<Setter Property="Foreground" |
||||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
Value="{DynamicResource SemiHighlightedInEdgeBrush}" /> |
||||||
Path="Source.ActualWidth" /> |
</MultiTrigger> |
||||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
<MultiTrigger> |
||||||
Path="Source.ActualHeight" /> |
<MultiTrigger.Conditions> |
||||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" |
||||||
Path="Target.(GraphSharp_Controls:GraphCanvas.X)" /> |
Value="True" /> |
||||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.SemiHighlightInfo" |
||||||
Path="Target.(GraphSharp_Controls:GraphCanvas.Y)" /> |
Value="OutEdge" /> |
||||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
</MultiTrigger.Conditions> |
||||||
Path="Target.ActualWidth" /> |
<Setter Property="Foreground" |
||||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
Value="{DynamicResource SemiHighlightedOutEdgeBrush}" /> |
||||||
Path="Target.ActualHeight" /> |
</MultiTrigger> |
||||||
<Binding RelativeSource="{RelativeSource TemplatedParent}" |
</Style.Triggers> |
||||||
Path="RoutePoints" /> |
</Style> |
||||||
</MultiBinding> |
|
||||||
</PathGeometry.Figures> |
|
||||||
</PathGeometry> |
|
||||||
</Path.Data> |
|
||||||
</Path> |
|
||||||
</ControlTemplate> |
|
||||||
</Setter.Value> |
|
||||||
</Setter> |
|
||||||
<Setter Property="GraphSharp_Controls:GraphElementBehaviour.HighlightTrigger" |
|
||||||
Value="{Binding RelativeSource={RelativeSource Self}, Path=IsMouseOver}" /> |
|
||||||
<Setter Property="MinWidth" |
|
||||||
Value="1" /> |
|
||||||
<Setter Property="MinHeight" |
|
||||||
Value="1" /> |
|
||||||
<Setter Property="Background" |
|
||||||
Value="Red" /> |
|
||||||
<Setter Property="Foreground" |
|
||||||
Value="Silver" /> |
|
||||||
<Setter Property="Opacity" |
|
||||||
Value="0.5" /> |
|
||||||
<Style.Triggers> |
|
||||||
<Trigger Property="GraphSharp_Controls:GraphElementBehaviour.IsHighlighted" |
|
||||||
Value="True"> |
|
||||||
<Setter Property="Foreground" |
|
||||||
Value="{DynamicResource HighlightedEdgeBrush}" /> |
|
||||||
</Trigger> |
|
||||||
<Trigger Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" |
|
||||||
Value="True"> |
|
||||||
<Setter Property="Foreground" |
|
||||||
Value="{DynamicResource HighlightedEdgeBrush}" /> |
|
||||||
</Trigger> |
|
||||||
<MultiTrigger> |
|
||||||
<MultiTrigger.Conditions> |
|
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" |
|
||||||
Value="True" /> |
|
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.SemiHighlightInfo" |
|
||||||
Value="InEdge" /> |
|
||||||
</MultiTrigger.Conditions> |
|
||||||
<Setter Property="Foreground" |
|
||||||
Value="{DynamicResource SemiHighlightedInEdgeBrush}" /> |
|
||||||
</MultiTrigger> |
|
||||||
<MultiTrigger> |
|
||||||
<MultiTrigger.Conditions> |
|
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" |
|
||||||
Value="True" /> |
|
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.SemiHighlightInfo" |
|
||||||
Value="OutEdge" /> |
|
||||||
</MultiTrigger.Conditions> |
|
||||||
<Setter Property="Foreground" |
|
||||||
Value="{DynamicResource SemiHighlightedOutEdgeBrush}" /> |
|
||||||
</MultiTrigger> |
|
||||||
</Style.Triggers> |
|
||||||
</Style> |
|
||||||
|
|
||||||
<Style TargetType="{x:Type GraphSharp_Controls:CompoundVertexControl}"> |
|
||||||
<Setter Property="Template"> |
|
||||||
<Setter.Value> |
|
||||||
<ControlTemplate TargetType="{x:Type GraphSharp_Controls:CompoundVertexControl}"> |
|
||||||
<Border BorderBrush="{TemplateBinding BorderBrush}" |
|
||||||
BorderThickness="{TemplateBinding BorderThickness}" |
|
||||||
Background="{TemplateBinding Background}" |
|
||||||
Padding="10"> |
|
||||||
<GroupBox> |
|
||||||
<GroupBox.Header> |
|
||||||
adfajkdsfklad |
|
||||||
</GroupBox.Header> |
|
||||||
|
|
||||||
<ItemsControl x:Name="PART_InnerCanvas" |
|
||||||
ItemsSource="{TemplateBinding Vertices}"> |
|
||||||
<ItemsControl.ItemsPanel> |
|
||||||
<ItemsPanelTemplate> |
|
||||||
<StackPanel Orientation="Vertical" /> |
|
||||||
</ItemsPanelTemplate> |
|
||||||
</ItemsControl.ItemsPanel> |
|
||||||
</ItemsControl> |
|
||||||
</GroupBox> |
|
||||||
</Border> |
|
||||||
</ControlTemplate> |
|
||||||
</Setter.Value> |
|
||||||
</Setter> |
|
||||||
|
|
||||||
<Setter Property="GraphSharp_Controls:GraphElementBehaviour.HighlightTrigger" |
|
||||||
Value="{Binding RelativeSource={RelativeSource Self},Path=IsMouseOver}" /> |
|
||||||
<Setter Property="WPFExtensions_AttachedBehaviours:DragBehaviour.IsDragEnabled" |
|
||||||
Value="True" /> |
|
||||||
<Setter Property="WPFExtensions_AttachedBehaviours:DragBehaviour.X" |
|
||||||
Value="{Binding RelativeSource={RelativeSource Self},Path=(GraphSharp_Controls:GraphCanvas.X),Mode=TwoWay}" /> |
|
||||||
<Setter Property="WPFExtensions_AttachedBehaviours:DragBehaviour.Y" |
|
||||||
Value="{Binding RelativeSource={RelativeSource Self},Path=(GraphSharp_Controls:GraphCanvas.Y),Mode=TwoWay}" /> |
|
||||||
<Setter Property="BorderThickness" |
|
||||||
Value="22" /> |
|
||||||
<Setter Property="BorderBrush" |
|
||||||
Value="Silver" /> |
|
||||||
<Setter Property="Background"> |
|
||||||
<Setter.Value> |
|
||||||
<LinearGradientBrush StartPoint="0,0" |
|
||||||
EndPoint="1,1"> |
|
||||||
<GradientStop Color="White" |
|
||||||
Offset="0" /> |
|
||||||
<GradientStop Color="BurlyWood" |
|
||||||
Offset="1" /> |
|
||||||
</LinearGradientBrush> |
|
||||||
</Setter.Value> |
|
||||||
</Setter> |
|
||||||
<Style.Triggers> |
|
||||||
<Trigger Property="LayoutMode" |
|
||||||
Value="Automatic"> |
|
||||||
<Setter Property="Template"> |
|
||||||
<Setter.Value> |
|
||||||
<ControlTemplate TargetType="{x:Type GraphSharp_Controls:CompoundVertexControl}"> |
|
||||||
<Border BorderBrush="{TemplateBinding BorderBrush}" |
|
||||||
BorderThickness="{TemplateBinding BorderThickness}" |
|
||||||
Background="{TemplateBinding Background}" |
|
||||||
Padding="10"> |
|
||||||
<GroupBox> |
|
||||||
<GroupBox.Header> |
|
||||||
wdawew |
|
||||||
</GroupBox.Header> |
|
||||||
|
|
||||||
<ItemsControl x:Name="PART_InnerCanvas" |
|
||||||
ItemsSource="{TemplateBinding Vertices}"> |
|
||||||
<ItemsControl.ItemsPanel> |
|
||||||
<ItemsPanelTemplate> |
|
||||||
<GraphSharp_Controls:GraphCanvas Background="White"/> |
|
||||||
</ItemsPanelTemplate> |
|
||||||
</ItemsControl.ItemsPanel> |
|
||||||
</ItemsControl> |
|
||||||
</GroupBox> |
|
||||||
</Border> |
|
||||||
</ControlTemplate> |
|
||||||
</Setter.Value> |
|
||||||
</Setter> |
|
||||||
<Setter Property="Background"> |
|
||||||
<Setter.Value> |
|
||||||
<LinearGradientBrush StartPoint="0,0" |
|
||||||
EndPoint="1,1"> |
|
||||||
<GradientStop Color="White" |
|
||||||
Offset="0" /> |
|
||||||
<GradientStop Color="Silver" |
|
||||||
Offset="1" /> |
|
||||||
</LinearGradientBrush> |
|
||||||
</Setter.Value> |
|
||||||
</Setter> |
|
||||||
</Trigger> |
|
||||||
<Trigger Property="GraphSharp_Controls:GraphElementBehaviour.IsHighlighted" |
|
||||||
Value="True"> |
|
||||||
<Setter Property="BorderBrush" |
|
||||||
Value="Orange" /> |
|
||||||
<Setter Property="BorderThickness" |
|
||||||
Value="2" /> |
|
||||||
</Trigger> |
|
||||||
<Trigger Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" |
|
||||||
Value="True"> |
|
||||||
<Setter Property="BorderBrush" |
|
||||||
Value="Yellow" /> |
|
||||||
<Setter Property="BorderThickness" |
|
||||||
Value="2" /> |
|
||||||
</Trigger> |
|
||||||
<MultiTrigger> |
|
||||||
<MultiTrigger.Conditions> |
|
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" |
|
||||||
Value="True" /> |
|
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.SemiHighlightInfo" |
|
||||||
Value="Source" /> |
|
||||||
</MultiTrigger.Conditions> |
|
||||||
<Setter Property="BorderBrush" |
|
||||||
Value="Red" /> |
|
||||||
<Setter Property="BorderThickness" |
|
||||||
Value="2" /> |
|
||||||
</MultiTrigger> |
|
||||||
<MultiTrigger> |
|
||||||
<MultiTrigger.Conditions> |
|
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.IsSemiHighlighted" |
|
||||||
Value="True" /> |
|
||||||
<Condition Property="GraphSharp_Controls:GraphElementBehaviour.SemiHighlightInfo" |
|
||||||
Value="Target" /> |
|
||||||
</MultiTrigger.Conditions> |
|
||||||
<Setter Property="BorderBrush" |
|
||||||
Value="Blue" /> |
|
||||||
<Setter Property="BorderThickness" |
|
||||||
Value="2" /> |
|
||||||
</MultiTrigger> |
|
||||||
</Style.Triggers> |
|
||||||
</Style> |
|
||||||
</ResourceDictionary> |
</ResourceDictionary> |
||||||
@ -0,0 +1,28 @@ |
|||||||
|
using System; |
||||||
|
using System.Windows.Data; |
||||||
|
using System.Globalization; |
||||||
|
using System.Windows.Media.Imaging; |
||||||
|
|
||||||
|
namespace ICSharpCode.CodeQualityAnalysis.Controls |
||||||
|
{ |
||||||
|
/// <summary>
|
||||||
|
/// Description of DependencyVertexConverter.
|
||||||
|
/// </summary>
|
||||||
|
[ValueConversion(typeof(object), typeof(BitmapSource))] |
||||||
|
public class DependencyIconVertexConverter : IValueConverter |
||||||
|
{ |
||||||
|
public object Convert(object value, System.Type targetType, object parameter, CultureInfo culture) |
||||||
|
{ |
||||||
|
var vertex = value as DependencyVertex; |
||||||
|
if (value != null) |
||||||
|
return vertex.Node.Icon; |
||||||
|
else |
||||||
|
return null; |
||||||
|
} |
||||||
|
|
||||||
|
public object ConvertBack(object value, System.Type targetType, object parameter, CultureInfo culture) |
||||||
|
{ |
||||||
|
return value; |
||||||
|
} |
||||||
|
} |
||||||
|
} |
||||||
Loading…
Reference in new issue