Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions Nodify/Editor/NodifyEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -259,8 +259,11 @@ private void ApplyRenderingOptimizations()
public static readonly DependencyProperty BringIntoViewMaxDurationProperty = DependencyProperty.Register(nameof(BringIntoViewMaxDuration), typeof(double), typeof(NodifyEditor), new FrameworkPropertyMetadata(BoxValue.Double1));
public static readonly DependencyProperty DisplayConnectionsOnTopProperty = DependencyProperty.Register(nameof(DisplayConnectionsOnTop), typeof(bool), typeof(NodifyEditor), new FrameworkPropertyMetadata(BoxValue.False));
public static readonly DependencyProperty ConnectionTemplateProperty = DependencyProperty.Register(nameof(ConnectionTemplate), typeof(DataTemplate), typeof(NodifyEditor));
public static readonly DependencyProperty ConnectionTemplateSelectorProperty = DependencyProperty.Register(nameof(ConnectionTemplateSelector), typeof(DataTemplateSelector), typeof(NodifyEditor));
public static readonly DependencyProperty DecoratorTemplateProperty = DependencyProperty.Register(nameof(DecoratorTemplate), typeof(DataTemplate), typeof(NodifyEditor));
public static readonly DependencyProperty DecoratorTemplateSelectorProperty = DependencyProperty.Register(nameof(DecoratorTemplateSelector), typeof(DataTemplateSelector), typeof(NodifyEditor));
public static readonly DependencyProperty PendingConnectionTemplateProperty = DependencyProperty.Register(nameof(PendingConnectionTemplate), typeof(DataTemplate), typeof(NodifyEditor));
public static readonly DependencyProperty PendingConnectionTemplateSelectorProperty = DependencyProperty.Register(nameof(PendingConnectionTemplateSelector), typeof(DataTemplateSelector), typeof(NodifyEditor));
public static readonly DependencyProperty DecoratorContainerStyleProperty = DependencyProperty.Register(nameof(DecoratorContainerStyle), typeof(Style), typeof(NodifyEditor));

/// <summary>
Expand Down Expand Up @@ -300,6 +303,15 @@ public DataTemplate ConnectionTemplate
set => SetValue(ConnectionTemplateProperty, value);
}

/// <summary>
/// Gets or sets the custom logic for choosing a template for <see cref="BaseConnection"/>.
/// </summary>
public DataTemplateSelector ConnectionTemplateSelector
{
get => (DataTemplateSelector)GetValue(ConnectionTemplateSelectorProperty);
set => SetValue(ConnectionTemplateSelectorProperty, value);
}

/// <summary>
/// Gets or sets the <see cref="DataTemplate"/> to use when generating a new <see cref="DecoratorContainer"/>.
/// </summary>
Expand All @@ -309,6 +321,15 @@ public DataTemplate DecoratorTemplate
set => SetValue(DecoratorTemplateProperty, value);
}

/// <summary>
/// Gets or sets the custom logic for choosing a template for <see cref="DecoratorContainer"/>.
/// </summary>
public DataTemplateSelector DecoratorTemplateSelector
{
get => (DataTemplateSelector)GetValue(DecoratorTemplateSelectorProperty);
set => SetValue(DecoratorTemplateSelectorProperty, value);
}

/// <summary>
/// Gets or sets the <see cref="DataTemplate"/> to use for the <see cref="PendingConnection"/>.
/// </summary>
Expand All @@ -318,6 +339,15 @@ public DataTemplate PendingConnectionTemplate
set => SetValue(PendingConnectionTemplateProperty, value);
}

/// <summary>
/// Gets or sets the custom logic for choosing a template for <see cref="PendingConnection"/>.
/// </summary>
public DataTemplateSelector PendingConnectionTemplateSelector
{
get => (DataTemplateSelector)GetValue(PendingConnectionTemplateSelectorProperty);
set => SetValue(PendingConnectionTemplateSelectorProperty, value);
}

/// <summary>
/// Gets or sets the style to use for the <see cref="DecoratorContainer"/>.
/// </summary>
Expand Down
2 changes: 2 additions & 0 deletions Nodify/Themes/Styles/NodifyEditor.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
SelectedItems="{TemplateBinding SelectedConnections}"
CanSelectMultipleItems="{TemplateBinding CanSelectMultipleConnections}"
ItemTemplate="{TemplateBinding ConnectionTemplate}"
ItemTemplateSelector="{TemplateBinding ConnectionTemplateSelector}"
IsTabStop="False">
<local:ConnectionsMultiSelector.Style>
<Style TargetType="local:ConnectionsMultiSelector">
Expand Down Expand Up @@ -172,6 +173,7 @@
<local:DecoratorsControl ItemsSource="{TemplateBinding Decorators}"
ItemContainerStyle="{TemplateBinding DecoratorContainerStyle}"
ItemTemplate="{TemplateBinding DecoratorTemplate}"
ItemTemplateSelector="{TemplateBinding DecoratorTemplateSelector}"
IsTabStop="False">
<local:DecoratorsControl.ItemsPanel>
<ItemsPanelTemplate>
Expand Down
Loading