Posted 16 years ago
by Eli Gazit
-
CEO,
Softwear Suit Ltd

I am trying to bind the Ribbon Gallery to a BindigList<MyObject> and to present a text and image as Items. Each time I add an item to the BindingList it is being added to the gallery but:
1. There is only one item in the first Row in the visible gallery (it is ok in the popup one).
2. The buttons up and down are disabled.
What am I doing wrong?
1. There is only one item in the first Row in the visible gallery (it is ok in the popup one).
2. The buttons up and down are disabled.
What am I doing wrong?
private BindingList<SidePrintegerListBoxItem> _items =
new BindingList<SidePrintegerListBoxItem>();
public BindingList<SidePrintegerListBoxItem> Items
{
get { return _items; }
}
<ribbon:RibbonGallery
x:Name="rgExportManager"
ImageSourceLarge="/LogbiGUI;component/Resources/Images/export32.png"
Label="Export Manager" KeyTipAccessText="X"
ScreenTipDescription="Export Manager Slides Gallery." MinWidth="300">
<ribbon:RibbonGallery.ItemTemplate>
<DataTemplate>
<StackPanel>
<Border BorderBrush="Black" BorderThickness="2"
CornerRadius="5">
<Image Source="{Binding Path=BitImage}"
Stretch="Fill" Width="50" Height="50" />
</Border>
<TextBlock Margin="3"
Text="{Binding Path=HeaderText}" />
</StackPanel>
</DataTemplate>
</ribbon:RibbonGallery.ItemTemplate>
<ribbon:RibbonGallery.PopupContent>
<StackPanel>
<ribbon:PopupGallery
InitialColumnCount="4"
ItemTemplate="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ribbon:RibbonGallery}}, Path=ItemTemplate}"
ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ribbon:RibbonGallery}}, Path=ItemsSource}" />
<ribbon:Separator />
<ribbon:Menu>
<ribbon:Button Label="Save Selection as a New Quick Style..." KeyTipAccessText="Q" />
<ribbon:Button KeyTipAccessText="C" />
<ribbon:Button Label="Apply Styles..." KeyTipAccessText="A" />
</ribbon:Menu>
</StackPanel>
</ribbon:RibbonGallery.PopupContent>
</ribbon:RibbonGallery>