-
Beta Was this translation helpful? Give feedback.
Answered by
miroiu
Apr 18, 2026
Replies: 1 comment 5 replies
-
|
Hi, there are multiple ways of doing this, depending on how you structure your view models. Here's an example using data templating:
public class BaseInputViewModel
{
public string Title { get; set; }
}
public class IntegerInputViewModel : BaseInputViewModel
{
public int Value { get; set; }
public ObservableCollection<int> AllowedValues { get; set; } = [];
}
public class StringInputViewModel : BaseInputViewModel
{
public string Value { get; set; }
}
public class NodeViewModel
{
public ObservableCollection<BaseInputViewModel> Input { get; } = [];
public string Title { get; set; }
}
<DataTemplate DataType="{x:Type local:NodeViewModel}">
<nodify:Node Input="{Binding Input}"
InputConnectorTemplate="{x:Null}"
Header="{Binding Title}" />
</DataTemplate><DataTemplate DataType="{x:Type local:StringInputViewModel}">
<nodify:NodeInput IsConnected="True"
Header="{Binding}">
<nodify:NodeInput.HeaderTemplate>
<DataTemplate DataType="{x:Type local:StringInputViewModel}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Title}" />
<TextBox Text="{Binding Value}" />
</StackPanel>
</DataTemplate>
</nodify:NodeInput.HeaderTemplate>
</nodify:NodeInput>
</DataTemplate><DataTemplate DataType="{x:Type local:IntegerInputViewModel}">
<nodify:NodeInput IsConnected="True"
Header="{Binding}">
<nodify:NodeInput.HeaderTemplate>
<DataTemplate DataType="{x:Type local:IntegerInputViewModel}">
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding Title}" />
<ComboBox SelectedValue="{Binding Value}"
ItemsSource="{Binding AllowedValues}" />
</StackPanel>
</DataTemplate>
</nodify:NodeInput.HeaderTemplate>
</nodify:NodeInput>
</DataTemplate>
|
Beta Was this translation helpful? Give feedback.
5 replies
Answer selected by
KeeeeepOn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


Hi, there are multiple ways of doing this, depending on how you structure your view models.
Here's an example using data templating: