But now, instead of the ViewToolbar having just a Map property, it has a Maps property, which is an ObservableCollection<Map> (could be any collection type really). So the control can now support working with multiple maps. I can set this Maps collection in the code behind, and it works, but I would like to set it in the XAML similar to the above example. I would like to do something like this:
<sdl:ViewToolbar x:Name="ViewToolbar">
<sdl:ViewToolbar.Maps>
<!-- How do I bind to multiple existing maps here? -->
</sdl:ViewToolbar.Maps>
</sdl:ViewToolbar>
Is this possible? Can I create a ObservableCollection resource or something and bind to that? Or do I have to do it in code?
It seems like ObservableCollection is not available in XAML. I have tried to include System.Collections.ObjectModel assembly before too and this type is not available in the intellisense. In this forum post, they suggest creating your local class that inherits from ObservableCollection and creating an instance of your class in XAML instead.
That is great, and I see what they are doing there... but how do I add/bind an existing map into the collection in XAML? I don't want to create a new map in the collection, but bind an existing one...
I probably could create a map container class with a map property inside it and then bind to that I suppose... but would be nice to just stick a reference to the map right in a map collection.