Skip to content
Discussion options

You must be logged in to vote

Hi, there are multiple ways of doing this, depending on how you structure your view models.

Here's an example using data templating:

  • create a base view model for the input and extend it for each input type
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; }
}
  • create the node view model
public class NodeViewModel
{
    public ObservableCollection<BaseInputViewModel> Input { get; } = [];
    public string T…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@KeeeeepOn
Comment options

@KeeeeepOn
Comment options

@miroiu
Comment options

@miroiu
Comment options

@KeeeeepOn
Comment options

Answer selected by KeeeeepOn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants