RibbonGroup DataBinding

Ribbon for WPF Forum

Posted 15 years ago by Jon Cain - Software Architect, AutoMon Corporation
Version: 9.2.0514
Avatar
Is is possible to databind an ItemsSource to the Ribbon Group control? I have the following code, but rather that displaying my popup buttons, it just renders ToString() on my objects.

<ribbon:Group
  x:Class="Automon.CE_LEGAL.Modules.Dashboard.DashboardGroup"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
  xmlns:inf="clr-namespace:Automon.CE_LEGAL.Infrastructure;assembly=Automon.CE_LEGAL.Infrastructure"
  xmlns:data="clr-namespace:Automon.CE_LEGAL.Entities;assembly=Automon.CE_LEGAL.Entities"
  Label="Dashboard" ItemsSource="{Binding Configuration.Categories}" >
  <ribbon:Group.ItemTemplate>
    <DataTemplate>
      <ribbon:PopupButton Label="{Binding Description}" VariantSize="Large" ImageSourceLarge="{Binding ImageSourceLarge}" ImageSourceSmall="{Binding ImageSourceSmall}" >
        <ribbon:Menu ItemsSource="{Binding Gadgets}" >
          <ribbon:Menu.ItemTemplate>
            <DataTemplate>
              <ribbon:Button Label="{Binding Description}" ImageSourceSmall="{Binding ImageSourceSmall}"
                             Command="{Binding DataContext.AddGadgetItemCommand, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ribbon:Group}}}" CommandParameter="{Binding}" />
            </DataTemplate>
          </ribbon:Menu.ItemTemplate>
        </ribbon:Menu>
      </ribbon:PopupButton>
    </DataTemplate>
  </ribbon:Group.ItemTemplate>
</ribbon:Group>

Comments (1)

Posted 15 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Jon,

If you want to email over a simple sample project (without any contained .exe files) that shows it happening, we can take a look. However I'm not sure what you're doing here will work though.


Actipro Software Support

The latest build of this product (v24.1.4) was released 30 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.