I have a custom user control that is based on a Grid control. I have a ViewModel that exposes this as a property. I would like the XAML on the view to bind to this. I am sure this must be easy but I am quite new to WPF. How is this achieved?
Many thanks in advance
(Edited to add more info)
Example of view without binding to ViewModel. Note that I have a custom grid that contains a number of custom stack panels which contains a number of custom headered content controls. These are determined during the ViewModel load.
<MyCustomGrid:CustomGrid>
<MyCustomGrid:CustomStackPanel>
<MyCustomGrid:CustomHeaderedContentControl/>
</MyCustomGrid:CustomStackPanel>
<MyCustomGrid:CustomStackPanel>
<MyCustomGrid:CustomHeaderedContentControl/>
</MyCustomGrid:CustomStackPanel>
</MyCustomGrid:CustomGrid>
ViewModel simply contains a List which contains a List etc. Note that the CustomGrid is a list as there can be more than one, but only one with a specific property will be bound.