Hello,
i have an xamOutlookBar and i´m adding groups to it by data binding using data template in xaml. This is ok.
But i do it in xaml and i want to do it dynamically, by code.
And i don´t know how to bind the GroupHeaderTemplate and the GroupContentTemplate.
i want to do it cause the xamOutlookBar works in a user control and i want this user control completely generic so i can use it with any view model in a mvvm app.
I´m able to bind the xamOutlookBar but i am not able to acces to the groups properties.
this is the xaml-->
<ig:XamOutlookBar.GroupHeaderTemplate>
<DataTemplate>
<TextBlock Text="{Binding Prueba}">
</TextBlock>
</DataTemplate>
</ig:XamOutlookBar.GroupHeaderTemplate>
<ig:XamOutlookBar.GroupContentTemplate>
<ListBox ItemsSource="{Binding Products}" DisplayMemberPath="ProductName" >
</ListBox>
</ig:XamOutlookBar.GroupContentTemplate>
and this is the code that i was able to develop-->
Private Sub UserControl_Loaded(ByVal sender As Object, ByVal e As RoutedEventArgs)
Dim b As Binding = New Binding("Prueba")
b.Mode = BindingMode.OneWay Me.XamOutlookBar1.SetBinding(Infragistics.Controls.Menus.XamOutlookBar.GroupsSourceProperty, b)
End Sub
it´s possible to bind the GroupHeaderTemplate and the GroupContentTemplate by code to?
Any suggestion?
Thank you for your support.
Sincerely.
David A .
Hello Stefan,
thank you so much for your post it works perfect.
You are doing a really good work.
David Alonso.
Hello David,
I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.
Thank you for your post. I have been looking into it and I created a sample project for you with the functionality you want. Basically I used the XamlReader class to create a DataTemplate and I asset it to the XamOutlookBar’s GroupHeaderTemplate Property. You can follow this approach to create Templates for any element of the control. Please let me know if this helps you or you need further assistance on this matter.
Looking forward for your reply.