2

I'm new to binding.

I have ObservableCollection<MyClass> Classes binded to ComboBox.

I would like to bind to this ComboBox also my: string DefaultString = "Empty" because I cant (and I dont want to) add it to my collection.

Sth like this:

|---------|

-Empmty

And after changes:

|---------|

-Empty

-Class1

It's possible to do it in xaml, like two bindings to one element? What I should be looking for?

Zinnerox
  • 35
  • 4

1 Answers1

5

What I should be looking for?

The CompositeCollection class.

How to: Implement a CompositeCollection: https://msdn.microsoft.com/en-us/library/ms742405(v=vs.110).aspx

How do you bind a CollectionContainer to a collection in a view model?

mm8
  • 163,881
  • 10
  • 57
  • 88