79601899

Date: 2025-05-01 13:11:34
Score: 0.5
Natty:
Report link

So my misunderstanding was, that I thought that it would be possible to pass values via XAML to a ViewModel / POCO.

If I understand your comments correctly, I have (at least?) two options:

a) Create a DependencyProperty directly in the code-behind of my UserControl Child and pass the filename by binding. Just as if I were to use e.g. <TextBox Text={Binding ., Mode=OneWay} /> instead of my Child component.

b) Create instances of ChildViewModel in ParentViewModel and hold a property ObserveableCollection<ChildViewModel> in ParentViewModel.

Reasons:
  • Long answer (-0.5):
  • Has code block (-0.5):
  • Contains question mark (0.5):
  • Self-answer (0.5):
  • Low reputation (0.5):
Posted by: mre