Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
450
How to binding dynamically xamOutlookBar and its groups added dynamically too???
posted

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>

                <DataTemplate>

                    <ListBox ItemsSource="{Binding Products}" DisplayMemberPath="ProductName" >                    

                    </ListBox>

                </DataTemplate>

            </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 .