I'm providing all menu content dynamically from a viewmodel, as in this example:
Now I want to add some ContextTabGroups. If I statically define these groups in XAML, I get an InvalidOperationException:
"Items collection must be empty before using ItemsSource."
Trying to turn the ContextTabGroups into a binding doesn't make things any easier. The closest I managed to get was to create a custom converter to convert my viewmodel collection to a ContextTabGroupCollection, but this results in a similar exception:
<syncfusion:Ribbon ContextTabGroups="{Binding ContextTabGroups, Converter={StaticResource ContextTabGroupConverter}}" ItemsSource="{Binding MenuTabs}" />
"Operation is not valid while ItemsSource is in use. Access and modify elements with ItemsControl.ItemsSource instead."
What is the correct way to achieve this? Or is databinding simply not possible with ContextTabGroups?