3
votes

I've come across an interesting situation whilst starting to work with the WPF framework.

I have the following code to create an ObservableCollection of type Foo

ObservableCollection<Foo> myFoo;

Foo has the following Properties:

  • String Name
  • String Folder
  • ObservableCollection Items

Both Name and Folder have the OnPropertyChanged event implemented (Items already uses ObservableCollection so I believe no additional implementation work is necessary).

For every item within myFoo I would like to show the following:

  • Name
  • Folder
  • Every value of FileInfo.FullName within Items.

e.g.

  • Test Name 1
  • Test Folder 1
  • FileA.JPG
  • FileB.JPG
  • FileC.PNG

  • Test Name 2

  • Test Folder 2
  • FileD.JPG
  • FileE.JPG
  • FileF.JPG

I've implemented the binding for the Name and Folder properties, however I'm not too sure on how I should implement binding the value of each Items.FileInfo.FullName occurance.

Would I need to implement a Converter?

Many thanks for your help.

1
Which UI control you are using to show items ?Danilo Vulović
@KlausByskovHoffmann Looks to be just what I need, if you add your comment as an answer i'll gladly accept.Jamie Keeling

1 Answers