Add project files.
This commit is contained in:
68
Nodify/Themes/Styles/Connection.xaml
Normal file
68
Nodify/Themes/Styles/Connection.xaml
Normal file
@@ -0,0 +1,68 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<Style TargetType="{x:Type local:BaseConnection}">
|
||||
<Style.Triggers>
|
||||
<Trigger Property="local:CuttingLine.IsOverElement"
|
||||
Value="True">
|
||||
<Setter Property="Opacity"
|
||||
Value="0.4" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelectable"
|
||||
Value="True">
|
||||
<Setter Property="Cursor"
|
||||
Value="Hand" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type local:Connection}"
|
||||
BasedOn="{StaticResource {x:Type local:BaseConnection}}">
|
||||
<Setter Property="StrokeThickness"
|
||||
Value="3" />
|
||||
<Setter Property="Stroke"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Fill"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Spacing"
|
||||
Value="20" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type local:LineConnection}"
|
||||
BasedOn="{StaticResource {x:Type local:BaseConnection}}">
|
||||
<Setter Property="StrokeThickness"
|
||||
Value="3" />
|
||||
<Setter Property="Stroke"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Fill"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Spacing"
|
||||
Value="30" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type local:CircuitConnection}"
|
||||
BasedOn="{StaticResource {x:Type local:BaseConnection}}">
|
||||
<Setter Property="StrokeThickness"
|
||||
Value="3" />
|
||||
<Setter Property="Stroke"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Fill"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Spacing"
|
||||
Value="30" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type local:StepConnection}"
|
||||
BasedOn="{StaticResource {x:Type local:BaseConnection}}">
|
||||
<Setter Property="StrokeThickness"
|
||||
Value="3" />
|
||||
<Setter Property="Stroke"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Fill"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Spacing"
|
||||
Value="30" />
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
73
Nodify/Themes/Styles/Connector.xaml
Normal file
73
Nodify/Themes/Styles/Connector.xaml
Normal file
@@ -0,0 +1,73 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<Style TargetType="{x:Type local:Connector}">
|
||||
<Setter Property="BorderBrush"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Foreground"
|
||||
Value="White" />
|
||||
<Setter Property="Background"
|
||||
Value="Transparent" />
|
||||
<Setter Property="Width"
|
||||
Value="14" />
|
||||
<Setter Property="Height"
|
||||
Value="14" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:Connector}">
|
||||
<Ellipse x:Name="Connector"
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}"
|
||||
Stroke="{TemplateBinding BorderBrush}"
|
||||
Fill="Transparent"
|
||||
StrokeThickness="2" />
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsConnected"
|
||||
Value="True">
|
||||
<Setter TargetName="Connector"
|
||||
Property="Ellipse.Fill"
|
||||
Value="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Trigger>
|
||||
<Trigger Property="local:PendingConnection.IsOverElement"
|
||||
Value="True">
|
||||
<Setter TargetName="Connector"
|
||||
Property="Ellipse.Fill"
|
||||
Value="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type local:HotKeyControl}">
|
||||
<Setter Property="BorderBrush"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Background"
|
||||
Value="White" />
|
||||
<Setter Property="Foreground"
|
||||
Value="Black" />
|
||||
<Setter Property="Width"
|
||||
Value="16" />
|
||||
<Setter Property="Height"
|
||||
Value="16" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:HotKeyControl}">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
CornerRadius="3"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Width="{TemplateBinding Width}"
|
||||
Height="{TemplateBinding Height}">
|
||||
<TextBlock Text="{Binding Number, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center" />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
23
Nodify/Themes/Styles/Controls.xaml
Normal file
23
Nodify/Themes/Styles/Controls.xaml
Normal file
@@ -0,0 +1,23 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<!--NODES-->
|
||||
<ResourceDictionary Source="Node.xaml" />
|
||||
<ResourceDictionary Source="KnotNode.xaml" />
|
||||
<ResourceDictionary Source="GroupingNode.xaml" />
|
||||
<ResourceDictionary Source="StateNode.xaml" />
|
||||
<ResourceDictionary Source="Connector.xaml" />
|
||||
<ResourceDictionary Source="NodeInput.xaml" />
|
||||
<ResourceDictionary Source="NodeOutput.xaml" />
|
||||
<ResourceDictionary Source="Connection.xaml" />
|
||||
<ResourceDictionary Source="PendingConnection.xaml" />
|
||||
<ResourceDictionary Source="CuttingLine.xaml" />
|
||||
|
||||
<!--CORE-->
|
||||
<ResourceDictionary Source="ItemContainer.xaml" />
|
||||
<ResourceDictionary Source="DecoratorContainer.xaml" />
|
||||
<ResourceDictionary Source="NodifyEditor.xaml" />
|
||||
|
||||
<!--WIDGETS-->
|
||||
<ResourceDictionary Source="Minimap.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
16
Nodify/Themes/Styles/CuttingLine.xaml
Normal file
16
Nodify/Themes/Styles/CuttingLine.xaml
Normal file
@@ -0,0 +1,16 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<Style TargetType="{x:Type local:CuttingLine}">
|
||||
<Setter Property="StrokeThickness"
|
||||
Value="3" />
|
||||
<Setter Property="StrokeDashArray"
|
||||
Value="2 1" />
|
||||
<Setter Property="Stroke"
|
||||
Value="Red" />
|
||||
<Setter Property="Fill"
|
||||
Value="Red" />
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
25
Nodify/Themes/Styles/DecoratorContainer.xaml
Normal file
25
Nodify/Themes/Styles/DecoratorContainer.xaml
Normal file
@@ -0,0 +1,25 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<local:UnscaleTransformConverter x:Key="UnscaleTransformConverter" />
|
||||
|
||||
<Style TargetType="{x:Type local:DecoratorContainer}">
|
||||
<Setter Property="RenderTransform"
|
||||
Value="{Binding ViewportTransform, RelativeSource={RelativeSource AncestorType=local:NodifyEditor}, Converter={StaticResource UnscaleTransformConverter}}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:DecoratorContainer}">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
CornerRadius="3">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
79
Nodify/Themes/Styles/GroupingNode.xaml
Normal file
79
Nodify/Themes/Styles/GroupingNode.xaml
Normal file
@@ -0,0 +1,79 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
||||
|
||||
<Style TargetType="{x:Type local:GroupingNode}">
|
||||
<Setter Property="Background">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#3E3E42"
|
||||
Opacity=".5" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground"
|
||||
Value="White" />
|
||||
<Setter Property="HeaderBrush"
|
||||
Value="#1E1E1E" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="Transparent" />
|
||||
<Setter Property="Padding"
|
||||
Value="7 3" />
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="HorizontalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="MinHeight"
|
||||
Value="30" />
|
||||
<Setter Property="MinWidth"
|
||||
Value="150" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:GroupingNode}">
|
||||
<Border BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="3">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"
|
||||
MinHeight="30" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Background="{TemplateBinding HeaderBrush}"
|
||||
Cursor="SizeAll"
|
||||
CornerRadius="3 3 0 0"
|
||||
x:Name="PART_Header">
|
||||
<ContentPresenter ContentSource="Header"
|
||||
Margin="{TemplateBinding Padding}" />
|
||||
</Border>
|
||||
|
||||
<Grid Grid.Row="1"
|
||||
Background="{TemplateBinding Background}">
|
||||
<ContentPresenter x:Name="PART_Content"
|
||||
ContentSource="Content" />
|
||||
<Thumb x:Name="PART_ResizeThumb"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
Margin="0 0 2 2"
|
||||
MinHeight="20"
|
||||
Cursor="SizeNWSE"
|
||||
Foreground="{TemplateBinding Foreground}"
|
||||
Visibility="{TemplateBinding CanResize, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Thumb.Template>
|
||||
<ControlTemplate>
|
||||
<TextBlock Text="p"
|
||||
FontFamily="Marlett"
|
||||
FontSize="18" />
|
||||
</ControlTemplate>
|
||||
</Thumb.Template>
|
||||
</Thumb>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
89
Nodify/Themes/Styles/ItemContainer.xaml
Normal file
89
Nodify/Themes/Styles/ItemContainer.xaml
Normal file
@@ -0,0 +1,89 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<SolidColorBrush x:Key="ItemContainer.HighlightColor"
|
||||
Color="DodgerBlue" />
|
||||
|
||||
<DrawingBrush x:Key="ItemContainer.HighlightBrush"
|
||||
Viewport="0 0 24 24"
|
||||
ViewportUnits="Absolute"
|
||||
TileMode="Tile">
|
||||
<DrawingBrush.Drawing>
|
||||
<DrawingGroup>
|
||||
<GeometryDrawing Brush="{StaticResource ItemContainer.HighlightColor}">
|
||||
<GeometryDrawing.Geometry>
|
||||
<GeometryGroup>
|
||||
<RectangleGeometry Rect="0 0 50 50" />
|
||||
<RectangleGeometry Rect="50 50 50 50" />
|
||||
</GeometryGroup>
|
||||
</GeometryDrawing.Geometry>
|
||||
</GeometryDrawing>
|
||||
</DrawingGroup>
|
||||
</DrawingBrush.Drawing>
|
||||
</DrawingBrush>
|
||||
|
||||
<Style TargetType="{x:Type local:ItemContainer}">
|
||||
<Setter Property="BorderThickness"
|
||||
Value="1" />
|
||||
<Setter Property="SelectedBorderThickness"
|
||||
Value="2" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="SelectedBrush"
|
||||
Value="Orange" />
|
||||
<Setter Property="HighlightBrush"
|
||||
Value="{StaticResource ItemContainer.HighlightBrush}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:ItemContainer}">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
x:Name="Border"
|
||||
CornerRadius="3">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Style.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsSelected"
|
||||
Value="True" />
|
||||
<Condition Property="IsPreviewingSelection"
|
||||
Value="{x:Null}" />
|
||||
</MultiTrigger.Conditions>
|
||||
<MultiTrigger.Setters>
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{Binding SelectedBrush, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="Margin"
|
||||
Value="{Binding SelectedMargin, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="{Binding SelectedBorderThickness, RelativeSource={RelativeSource Self}}" />
|
||||
</MultiTrigger.Setters>
|
||||
</MultiTrigger>
|
||||
<Trigger Property="IsPreviewingSelection"
|
||||
Value="True">
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{Binding SelectedBrush, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="Margin"
|
||||
Value="{Binding SelectedMargin, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="{Binding SelectedBorderThickness, RelativeSource={RelativeSource Self}}" />
|
||||
</Trigger>
|
||||
<Trigger Property="local:PendingConnection.IsOverElement"
|
||||
Value="True">
|
||||
<Setter Property="BorderBrush"
|
||||
Value="{Binding HighlightBrush, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="Margin"
|
||||
Value="{Binding SelectedMargin, RelativeSource={RelativeSource Self}}" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="{Binding SelectedBorderThickness, RelativeSource={RelativeSource Self}}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
37
Nodify/Themes/Styles/KnotNode.xaml
Normal file
37
Nodify/Themes/Styles/KnotNode.xaml
Normal file
@@ -0,0 +1,37 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<DataTemplate x:Key="DefaultConnectorTemplate">
|
||||
<local:Connector Cursor="Arrow" />
|
||||
</DataTemplate>
|
||||
|
||||
<Style TargetType="{x:Type local:KnotNode}">
|
||||
<Setter Property="Background"
|
||||
Value="Transparent" />
|
||||
<Setter Property="Foreground"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="Transparent" />
|
||||
<Setter Property="Padding"
|
||||
Value="15 5" />
|
||||
<Setter Property="Cursor"
|
||||
Value="SizeAll" />
|
||||
<Setter Property="ContentTemplate"
|
||||
Value="{StaticResource DefaultConnectorTemplate}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:KnotNode}">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
CornerRadius="3">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
101
Nodify/Themes/Styles/Minimap.xaml
Normal file
101
Nodify/Themes/Styles/Minimap.xaml
Normal file
@@ -0,0 +1,101 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<local:SubtractConverter x:Key="SubtractConverter" />
|
||||
|
||||
<SolidColorBrush x:Key="MinimapBackground"
|
||||
Color="#121212"
|
||||
Opacity="0.7" />
|
||||
<SolidColorBrush x:Key="MinimapItemBackground"
|
||||
Color="DodgerBlue"
|
||||
Opacity="0.8" />
|
||||
|
||||
<Style x:Key="ViewportRectStyle"
|
||||
TargetType="Rectangle">
|
||||
<Setter Property="Stroke"
|
||||
Value="#74747c" />
|
||||
<Setter Property="StrokeThickness"
|
||||
Value="3" />
|
||||
<Setter Property="Fill">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Color="#74747c"
|
||||
Opacity="0.2" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type local:Minimap}">
|
||||
<Setter Property="Padding"
|
||||
Value="10" />
|
||||
<Setter Property="Background"
|
||||
Value="{StaticResource MinimapBackground}" />
|
||||
<Setter Property="ViewportStyle"
|
||||
Value="{StaticResource ViewportRectStyle}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:Minimap}">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
CornerRadius="3"
|
||||
ClipToBounds="True">
|
||||
<Viewbox Stretch="Uniform"
|
||||
Margin="{TemplateBinding Padding}">
|
||||
<Grid>
|
||||
<local:MinimapPanel ViewportSize="{TemplateBinding ViewportSize}"
|
||||
ViewportLocation="{TemplateBinding ViewportLocation}"
|
||||
ResizeToViewport="{TemplateBinding ResizeToViewport}"
|
||||
Extent="{Binding Extent, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWayToSource}"
|
||||
ItemsExtent="{Binding ItemsExtent, RelativeSource={RelativeSource TemplatedParent}, Mode=OneWayToSource}"
|
||||
IsItemsHost="True"
|
||||
x:Name="PART_ItemsHost" />
|
||||
<Canvas>
|
||||
<Rectangle Style="{TemplateBinding ViewportStyle}"
|
||||
Width="{Binding ViewportSize.Width, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Height="{Binding ViewportSize.Height, RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<Canvas.Top>
|
||||
<MultiBinding Converter="{StaticResource SubtractConverter}">
|
||||
<Binding Path="ViewportLocation.Y"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
<Binding Path="Extent.Location.Y"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
</MultiBinding>
|
||||
</Canvas.Top>
|
||||
<Canvas.Left>
|
||||
<MultiBinding Converter="{StaticResource SubtractConverter}">
|
||||
<Binding Path="ViewportLocation.X"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
<Binding Path="Extent.Location.X"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
</MultiBinding>
|
||||
</Canvas.Left>
|
||||
</Rectangle>
|
||||
</Canvas>
|
||||
</Grid>
|
||||
</Viewbox>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type local:MinimapItem}">
|
||||
<Setter Property="Background"
|
||||
Value="{StaticResource MinimapItemBackground}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:MinimapItem}">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
CornerRadius="3">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
138
Nodify/Themes/Styles/Node.xaml
Normal file
138
Nodify/Themes/Styles/Node.xaml
Normal file
@@ -0,0 +1,138 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
||||
|
||||
<DataTemplate x:Key="DefaultInputConnectorTemplate">
|
||||
<local:NodeInput />
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="DefaultOutputConnectorTemplate">
|
||||
<local:NodeOutput />
|
||||
</DataTemplate>
|
||||
|
||||
<Style x:Key="DefaultHeaderContainerStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="CornerRadius"
|
||||
Value="3 3 0 0" />
|
||||
<Setter Property="Padding"
|
||||
Value="6 4 6 4" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DefaultFooterContainerStyle"
|
||||
TargetType="Border">
|
||||
<Setter Property="CornerRadius"
|
||||
Value="0 0 3 3" />
|
||||
<Setter Property="Padding"
|
||||
Value="6 4 6 4" />
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type local:Node}">
|
||||
<Setter Property="Background"
|
||||
Value="#2D2D30" />
|
||||
<Setter Property="ContentBrush"
|
||||
Value="#2D2D30" />
|
||||
<Setter Property="HeaderBrush"
|
||||
Value="#1E1E1E" />
|
||||
<Setter Property="FooterBrush"
|
||||
Value="#1E1E1E" />
|
||||
<Setter Property="Foreground"
|
||||
Value="White" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="Transparent" />
|
||||
<Setter Property="MinHeight"
|
||||
Value="15" />
|
||||
<Setter Property="MinWidth"
|
||||
Value="15" />
|
||||
<Setter Property="VerticalAlignment"
|
||||
Value="Top" />
|
||||
<Setter Property="HorizontalAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="HorizontalContentAlignment"
|
||||
Value="Center" />
|
||||
<Setter Property="InputConnectorTemplate"
|
||||
Value="{StaticResource DefaultInputConnectorTemplate}" />
|
||||
<Setter Property="OutputConnectorTemplate"
|
||||
Value="{StaticResource DefaultOutputConnectorTemplate}" />
|
||||
<Setter Property="HeaderContainerStyle"
|
||||
Value="{StaticResource DefaultHeaderContainerStyle}" />
|
||||
<Setter Property="FooterContainerStyle"
|
||||
Value="{StaticResource DefaultFooterContainerStyle}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:Node}">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
CornerRadius="3">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="Auto" />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!--Header-->
|
||||
<Border Visibility="{TemplateBinding HasHeader, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Background="{TemplateBinding HeaderBrush}"
|
||||
Style="{TemplateBinding HeaderContainerStyle}"
|
||||
Grid.ColumnSpan="3">
|
||||
<ContentPresenter ContentSource="Header" />
|
||||
</Border>
|
||||
|
||||
<!--Body-->
|
||||
<Border Style="{TemplateBinding ContentContainerStyle}"
|
||||
Grid.Row="1">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!--Data IN-->
|
||||
<ItemsControl x:Name="PART_Input"
|
||||
ItemsSource="{TemplateBinding Input}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
ItemTemplate="{TemplateBinding InputConnectorTemplate}"
|
||||
Focusable="False" />
|
||||
|
||||
<!--Content-->
|
||||
<Border Grid.Column="1"
|
||||
Padding="16 0 16 0"
|
||||
Background="{TemplateBinding ContentBrush}">
|
||||
<ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
|
||||
</Border>
|
||||
|
||||
<!--Data OUT-->
|
||||
<ItemsControl x:Name="PART_Output"
|
||||
ItemsSource="{TemplateBinding Output}"
|
||||
ItemTemplate="{TemplateBinding OutputConnectorTemplate}"
|
||||
VerticalAlignment="{TemplateBinding VerticalAlignment}"
|
||||
HorizontalContentAlignment="Right"
|
||||
Grid.Column="2"
|
||||
Focusable="False" />
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<!--Footer-->
|
||||
<Border Visibility="{TemplateBinding HasFooter, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Background="{TemplateBinding FooterBrush}"
|
||||
Style="{TemplateBinding FooterContainerStyle}"
|
||||
Grid.Row="2"
|
||||
Grid.ColumnSpan="3">
|
||||
<ContentPresenter ContentSource="Footer" />
|
||||
</Border>
|
||||
</Grid>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
118
Nodify/Themes/Styles/NodeInput.xaml
Normal file
118
Nodify/Themes/Styles/NodeInput.xaml
Normal file
@@ -0,0 +1,118 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<ControlTemplate x:Key="ConnectorThumbTemplate"
|
||||
TargetType="Control">
|
||||
<Ellipse Width="14"
|
||||
Height="14"
|
||||
Stroke="{TemplateBinding BorderBrush}"
|
||||
Fill="{TemplateBinding Background}"
|
||||
StrokeThickness="2" />
|
||||
</ControlTemplate>
|
||||
|
||||
<LinearGradientBrush x:Key="FadeOpacityMask"
|
||||
StartPoint="0 0"
|
||||
EndPoint="1 0">
|
||||
<GradientStop Color="#22FFFFFF"
|
||||
Offset="0" />
|
||||
<GradientStop Color="#88FFFFFF"
|
||||
Offset="0.3" />
|
||||
<GradientStop Color="#88FFFFFF"
|
||||
Offset="0.7" />
|
||||
<GradientStop Color="#22FFFFFF"
|
||||
Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="FadeOpacityMaskVertical"
|
||||
StartPoint="0 0"
|
||||
EndPoint="0 1">
|
||||
<GradientStop Color="#22FFFFFF"
|
||||
Offset="0" />
|
||||
<GradientStop Color="#88FFFFFF"
|
||||
Offset="0.3" />
|
||||
<GradientStop Color="#88FFFFFF"
|
||||
Offset="0.7" />
|
||||
<GradientStop Color="#22FFFFFF"
|
||||
Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<Style TargetType="{x:Type local:NodeInput}">
|
||||
<Setter Property="BorderBrush"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Background"
|
||||
Value="#2D2D30" />
|
||||
<Setter Property="Foreground"
|
||||
Value="White" />
|
||||
<Setter Property="Padding"
|
||||
Value="4 2" />
|
||||
<Setter Property="ConnectorTemplate"
|
||||
Value="{StaticResource ConnectorThumbTemplate}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:NodeInput}">
|
||||
<Grid Background="{TemplateBinding Background}">
|
||||
<Border Visibility="Collapsed"
|
||||
x:Name="Highlight"
|
||||
OpacityMask="{StaticResource FadeOpacityMask}"
|
||||
Background="{TemplateBinding BorderBrush}" />
|
||||
|
||||
<StackPanel Orientation="{TemplateBinding Orientation}"
|
||||
Margin="{TemplateBinding Padding}">
|
||||
|
||||
<Control x:Name="PART_Connector"
|
||||
Focusable="False"
|
||||
Margin="0 0 5 0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Template="{TemplateBinding ConnectorTemplate}" />
|
||||
|
||||
<ContentPresenter ContentSource="Header" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Orientation"
|
||||
Value="Vertical">
|
||||
<Setter TargetName="PART_Connector"
|
||||
Property="Margin"
|
||||
Value="0 0 0 5" />
|
||||
<Setter Property="Padding"
|
||||
Value="2 4" />
|
||||
<Setter TargetName="Highlight"
|
||||
Property="OpacityMask"
|
||||
Value="{StaticResource FadeOpacityMaskVertical}" />
|
||||
</Trigger>
|
||||
|
||||
<Trigger Property="IsConnected"
|
||||
Value="True">
|
||||
<Setter TargetName="PART_Connector"
|
||||
Property="Background"
|
||||
Value="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Trigger>
|
||||
<Trigger Property="local:PendingConnection.IsOverElement"
|
||||
Value="True">
|
||||
<Setter TargetName="PART_Connector"
|
||||
Property="Background"
|
||||
Value="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver"
|
||||
Value="True">
|
||||
<Setter TargetName="Highlight"
|
||||
Property="Visibility"
|
||||
Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger Property="local:PendingConnection.IsOverElement"
|
||||
Value="True">
|
||||
<Setter TargetName="Highlight"
|
||||
Property="Visibility"
|
||||
Value="Visible" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
118
Nodify/Themes/Styles/NodeOutput.xaml
Normal file
118
Nodify/Themes/Styles/NodeOutput.xaml
Normal file
@@ -0,0 +1,118 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<ControlTemplate x:Key="ConnectorThumbTemplate"
|
||||
TargetType="Control">
|
||||
<Ellipse Width="14"
|
||||
Height="14"
|
||||
Stroke="{TemplateBinding BorderBrush}"
|
||||
Fill="{TemplateBinding Background}"
|
||||
StrokeThickness="2" />
|
||||
</ControlTemplate>
|
||||
|
||||
<LinearGradientBrush x:Key="FadeOpacityMask"
|
||||
StartPoint="0 0"
|
||||
EndPoint="1 0">
|
||||
<GradientStop Color="#22FFFFFF"
|
||||
Offset="0" />
|
||||
<GradientStop Color="#88FFFFFF"
|
||||
Offset="0.3" />
|
||||
<GradientStop Color="#88FFFFFF"
|
||||
Offset="0.7" />
|
||||
<GradientStop Color="#22FFFFFF"
|
||||
Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<LinearGradientBrush x:Key="FadeOpacityMaskVertical"
|
||||
StartPoint="0 0"
|
||||
EndPoint="0 1">
|
||||
<GradientStop Color="#22FFFFFF"
|
||||
Offset="0" />
|
||||
<GradientStop Color="#88FFFFFF"
|
||||
Offset="0.3" />
|
||||
<GradientStop Color="#88FFFFFF"
|
||||
Offset="0.7" />
|
||||
<GradientStop Color="#22FFFFFF"
|
||||
Offset="1" />
|
||||
</LinearGradientBrush>
|
||||
|
||||
<Style TargetType="{x:Type local:NodeOutput}">
|
||||
<Setter Property="BorderBrush"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="Background"
|
||||
Value="#2D2D30" />
|
||||
<Setter Property="Foreground"
|
||||
Value="White" />
|
||||
<Setter Property="Padding"
|
||||
Value="4 2" />
|
||||
<Setter Property="ConnectorTemplate"
|
||||
Value="{StaticResource ConnectorThumbTemplate}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:NodeOutput}">
|
||||
<Grid Background="{TemplateBinding Background}">
|
||||
<Border Visibility="Collapsed"
|
||||
x:Name="Highlight"
|
||||
OpacityMask="{StaticResource FadeOpacityMask}"
|
||||
Background="{TemplateBinding BorderBrush}" />
|
||||
|
||||
<StackPanel Orientation="{TemplateBinding Orientation}"
|
||||
HorizontalAlignment="Right"
|
||||
Margin="{TemplateBinding Padding}">
|
||||
|
||||
<ContentPresenter ContentSource="Header" />
|
||||
|
||||
<Control x:Name="PART_Connector"
|
||||
Focusable="False"
|
||||
Margin="5 0 0 0"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
Background="Transparent"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
Template="{TemplateBinding ConnectorTemplate}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="Orientation"
|
||||
Value="Vertical">
|
||||
<Setter TargetName="PART_Connector"
|
||||
Property="Margin"
|
||||
Value="0 5 0 0" />
|
||||
<Setter Property="Padding"
|
||||
Value="2 4" />
|
||||
<Setter TargetName="Highlight"
|
||||
Property="OpacityMask"
|
||||
Value="{StaticResource FadeOpacityMaskVertical}" />
|
||||
</Trigger>
|
||||
|
||||
<Trigger Property="IsConnected"
|
||||
Value="True">
|
||||
<Setter TargetName="PART_Connector"
|
||||
Property="Background"
|
||||
Value="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Trigger>
|
||||
<Trigger Property="local:PendingConnection.IsOverElement"
|
||||
Value="True">
|
||||
<Setter TargetName="PART_Connector"
|
||||
Property="Background"
|
||||
Value="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver"
|
||||
Value="True">
|
||||
<Setter TargetName="Highlight"
|
||||
Property="Visibility"
|
||||
Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger Property="local:PendingConnection.IsOverElement"
|
||||
Value="True">
|
||||
<Setter TargetName="Highlight"
|
||||
Property="Visibility"
|
||||
Value="Visible" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
212
Nodify/Themes/Styles/NodifyEditor.xaml
Normal file
212
Nodify/Themes/Styles/NodifyEditor.xaml
Normal file
@@ -0,0 +1,212 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
||||
<local:UnscaleTransformConverter x:Key="UnscaleTransformConverter" />
|
||||
<local:ScaleDoubleConverter x:Key="ScaleDoubleConverter" />
|
||||
<local:ScalePointConverter x:Key="ScalePointConverter" />
|
||||
|
||||
<DataTemplate x:Key="ConnectionTemplate">
|
||||
<local:Connection Style="{DynamicResource {x:Type local:Connection}}" />
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate x:Key="PendingConnectionTemplate">
|
||||
<local:PendingConnection IsTabStop="False"
|
||||
IsHitTestVisible="False" />
|
||||
</DataTemplate>
|
||||
|
||||
<Style x:Key="SelectionRectangleStyle"
|
||||
TargetType="Rectangle">
|
||||
<Setter Property="Stroke"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="StrokeThickness"
|
||||
Value="1" />
|
||||
<Setter Property="Fill">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.1"
|
||||
Color="DodgerBlue" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="PushedAreaStyle"
|
||||
TargetType="Rectangle">
|
||||
<Setter Property="Stroke"
|
||||
Value="#74747c" />
|
||||
<Setter Property="StrokeThickness"
|
||||
Value="1" />
|
||||
<Setter Property="Fill">
|
||||
<Setter.Value>
|
||||
<SolidColorBrush Opacity="0.2"
|
||||
Color="#74747c" />
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type local:NodifyEditor}">
|
||||
<Setter Property="Foreground"
|
||||
Value="White" />
|
||||
<Setter Property="Background"
|
||||
Value="#1E1E1E" />
|
||||
<Setter Property="EnableRealtimeSelection"
|
||||
Value="True" />
|
||||
<Setter Property="DisplayConnectionsOnTop"
|
||||
Value="False" />
|
||||
<Setter Property="SelectionRectangleStyle"
|
||||
Value="{StaticResource SelectionRectangleStyle}" />
|
||||
<Setter Property="PushedAreaStyle"
|
||||
Value="{StaticResource PushedAreaStyle}" />
|
||||
<Setter Property="ConnectionTemplate"
|
||||
Value="{StaticResource ConnectionTemplate}" />
|
||||
<Setter Property="PendingConnectionTemplate"
|
||||
Value="{StaticResource PendingConnectionTemplate}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:NodifyEditor}">
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
ClipToBounds="True">
|
||||
<Canvas RenderTransform="{TemplateBinding ViewportTransform}">
|
||||
<local:NodifyCanvas x:Name="PART_ItemsHost"
|
||||
IsItemsHost="True"
|
||||
Extent="{Binding ItemsExtent, Mode=OneWayToSource, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
|
||||
<local:ConnectionsMultiSelector x:Name="PART_ConnectionsHost"
|
||||
ItemsSource="{TemplateBinding Connections}"
|
||||
SelectedItem="{Binding SelectedConnection, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
SelectedItems="{TemplateBinding SelectedConnections}"
|
||||
CanSelectMultipleItems="{TemplateBinding CanSelectMultipleConnections}"
|
||||
ItemTemplate="{TemplateBinding ConnectionTemplate}"
|
||||
IsTabStop="False">
|
||||
<local:ConnectionsMultiSelector.Style>
|
||||
<Style TargetType="local:ConnectionsMultiSelector">
|
||||
<Setter Property="Panel.ZIndex"
|
||||
Value="-1" />
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding DisplayConnectionsOnTop, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Value="True">
|
||||
<Setter Property="Panel.ZIndex"
|
||||
Value="0" />
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</local:ConnectionsMultiSelector.Style>
|
||||
<local:ConnectionsMultiSelector.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<Canvas />
|
||||
</ItemsPanelTemplate>
|
||||
</local:ConnectionsMultiSelector.ItemsPanel>
|
||||
</local:ConnectionsMultiSelector>
|
||||
|
||||
<ContentPresenter ContentSource="PendingConnection" />
|
||||
|
||||
<Rectangle Style="{TemplateBinding SelectionRectangleStyle}"
|
||||
RenderTransform="{Binding ViewportTransform, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource UnscaleTransformConverter}}"
|
||||
Canvas.Top="{Binding SelectedArea.Y, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Canvas.Left="{Binding SelectedArea.X, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Visibility="{TemplateBinding IsSelecting, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Rectangle.Width>
|
||||
<MultiBinding Converter="{StaticResource ScaleDoubleConverter}">
|
||||
<Binding Path="SelectedArea.Width"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
<Binding Path="ViewportZoom"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
</MultiBinding>
|
||||
</Rectangle.Width>
|
||||
<Rectangle.Height>
|
||||
<MultiBinding Converter="{StaticResource ScaleDoubleConverter}">
|
||||
<Binding Path="SelectedArea.Height"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
<Binding Path="ViewportZoom"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
</MultiBinding>
|
||||
</Rectangle.Height>
|
||||
</Rectangle>
|
||||
|
||||
<Rectangle Style="{TemplateBinding PushedAreaStyle}"
|
||||
RenderTransform="{Binding ViewportTransform, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource UnscaleTransformConverter}}"
|
||||
Canvas.Top="{Binding PushedArea.Y, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Canvas.Left="{Binding PushedArea.X, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Visibility="{TemplateBinding IsPushingItems, Converter={StaticResource BooleanToVisibilityConverter}}">
|
||||
<Rectangle.Width>
|
||||
<MultiBinding Converter="{StaticResource ScaleDoubleConverter}">
|
||||
<Binding Path="PushedArea.Width"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
<Binding Path="ViewportZoom"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
</MultiBinding>
|
||||
</Rectangle.Width>
|
||||
<Rectangle.Height>
|
||||
<MultiBinding Converter="{StaticResource ScaleDoubleConverter}">
|
||||
<Binding Path="PushedArea.Height"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
<Binding Path="ViewportZoom"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
</MultiBinding>
|
||||
</Rectangle.Height>
|
||||
</Rectangle>
|
||||
|
||||
<local:CuttingLine Style="{TemplateBinding CuttingLineStyle}"
|
||||
Visibility="{TemplateBinding IsCutting, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
RenderTransform="{Binding ViewportTransform, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource UnscaleTransformConverter}}">
|
||||
<local:CuttingLine.StartPoint>
|
||||
<MultiBinding Converter="{StaticResource ScalePointConverter}">
|
||||
<Binding Path="CuttingLineStart"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
<Binding Path="ViewportZoom"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
</MultiBinding>
|
||||
</local:CuttingLine.StartPoint>
|
||||
<local:CuttingLine.EndPoint>
|
||||
<MultiBinding Converter="{StaticResource ScalePointConverter}">
|
||||
<Binding Path="CuttingLineEnd"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
<Binding Path="ViewportZoom"
|
||||
RelativeSource="{RelativeSource TemplatedParent}" />
|
||||
</MultiBinding>
|
||||
</local:CuttingLine.EndPoint>
|
||||
</local:CuttingLine>
|
||||
|
||||
<local:DecoratorsControl ItemsSource="{TemplateBinding Decorators}"
|
||||
ItemContainerStyle="{TemplateBinding DecoratorContainerStyle}"
|
||||
ItemTemplate="{TemplateBinding DecoratorTemplate}"
|
||||
IsTabStop="False">
|
||||
<local:DecoratorsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<local:NodifyCanvas Extent="{Binding DecoratorsExtent, Mode=OneWayToSource, RelativeSource={RelativeSource AncestorType=local:NodifyEditor}}" />
|
||||
</ItemsPanelTemplate>
|
||||
</local:DecoratorsControl.ItemsPanel>
|
||||
</local:DecoratorsControl>
|
||||
</Canvas>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
<Style.Triggers>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsPushingItems"
|
||||
Value="True" />
|
||||
<Condition Property="PushedAreaOrientation"
|
||||
Value="Horizontal" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Cursor"
|
||||
Value="SizeWE" />
|
||||
</MultiTrigger>
|
||||
<MultiTrigger>
|
||||
<MultiTrigger.Conditions>
|
||||
<Condition Property="IsPushingItems"
|
||||
Value="True" />
|
||||
<Condition Property="PushedAreaOrientation"
|
||||
Value="Vertical" />
|
||||
</MultiTrigger.Conditions>
|
||||
<Setter Property="Cursor"
|
||||
Value="SizeNS" />
|
||||
</MultiTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
61
Nodify/Themes/Styles/PendingConnection.xaml
Normal file
61
Nodify/Themes/Styles/PendingConnection.xaml
Normal file
@@ -0,0 +1,61 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
|
||||
|
||||
<Style TargetType="{x:Type local:PendingConnection}">
|
||||
<Setter Property="Background"
|
||||
Value="#121212" />
|
||||
<Setter Property="Foreground"
|
||||
Value="White" />
|
||||
<Setter Property="Stroke"
|
||||
Value="DodgerBlue" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="Black" />
|
||||
<Setter Property="EnablePreview"
|
||||
Value="False" />
|
||||
<Setter Property="StrokeThickness"
|
||||
Value="3" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="1" />
|
||||
<Setter Property="Visibility"
|
||||
Value="Hidden" />
|
||||
<Setter Property="StrokeDashArray"
|
||||
Value="4 4" />
|
||||
<Setter Property="Padding"
|
||||
Value="5" />
|
||||
<Setter Property="EnableSnapping"
|
||||
Value="True" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:PendingConnection}">
|
||||
<Canvas>
|
||||
<local:LineConnection Source="{TemplateBinding SourceAnchor}"
|
||||
Target="{TemplateBinding TargetAnchor}"
|
||||
Stroke="{TemplateBinding Stroke}"
|
||||
StrokeThickness="{TemplateBinding StrokeThickness}"
|
||||
StrokeDashArray="{TemplateBinding StrokeDashArray}"
|
||||
Direction="{TemplateBinding Direction}"
|
||||
Spacing="0"
|
||||
ArrowSize="0 0"
|
||||
SourceOffsetMode="None"
|
||||
TargetOffsetMode="None" />
|
||||
<Border Background="{TemplateBinding Background}"
|
||||
Canvas.Left="{Binding TargetAnchor.X, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Canvas.Top="{Binding TargetAnchor.Y, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Visibility="{TemplateBinding EnablePreview, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
CornerRadius="3"
|
||||
Margin="15">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
</Canvas>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
63
Nodify/Themes/Styles/StateNode.xaml
Normal file
63
Nodify/Themes/Styles/StateNode.xaml
Normal file
@@ -0,0 +1,63 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:Nodify">
|
||||
|
||||
<Style TargetType="{x:Type local:StateNode}">
|
||||
<Setter Property="Padding"
|
||||
Value="7 5" />
|
||||
<Setter Property="BorderThickness"
|
||||
Value="10" />
|
||||
<Setter Property="BorderBrush"
|
||||
Value="#484848" />
|
||||
<Setter Property="Background"
|
||||
Value="#171717" />
|
||||
<Setter Property="Foreground"
|
||||
Value="White" />
|
||||
<Setter Property="HighlightBrush"
|
||||
Value="#D6D3D6" />
|
||||
<Setter Property="CornerRadius"
|
||||
Value="3" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type local:StateNode}">
|
||||
<Border x:Name="Border"
|
||||
Padding="{TemplateBinding BorderThickness}"
|
||||
Margin="{TemplateBinding Margin}"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<Border x:Name="PART_Content"
|
||||
Background="{TemplateBinding Background}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Cursor="SizeAll"
|
||||
MinWidth="30"
|
||||
MinHeight="30"
|
||||
CornerRadius="{TemplateBinding CornerRadius}">
|
||||
<ContentPresenter />
|
||||
</Border>
|
||||
<Border.Style>
|
||||
<Style TargetType="Border">
|
||||
<Setter Property="Background"
|
||||
Value="{Binding BorderBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseDirectlyOver"
|
||||
Value="True">
|
||||
<Setter Property="Background"
|
||||
Value="{Binding HighlightBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</Border.Style>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="local:PendingConnection.IsOverElement"
|
||||
Value="True">
|
||||
<Setter Property="Background"
|
||||
TargetName="Border"
|
||||
Value="{Binding HighlightBrush, RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user