Bind Bug in RibbonGallery

Ribbon for WPF Forum

Posted 10 years ago by Eli Gazit - CEO, Softwear Suit Ltd
Avatar
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?

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>

Comments (3)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Eli,

It's hard to tell without something to debug, but it's possible that you are reusing visuals. As you probably know, a Visual (which I'm assuming your SidePrintegerListBoxItem is) can only belong to one parent. In this case, the RibbonGallery would be one parent, and the PopupGallery would be the second. Most times you'd get an exception when this occurs, but there are times when it will simply not render the Visual in one or both locations.

If that doesn't help, please put together a small sample project and email it over to our support email then we can take a look.


Actipro Software Support

Posted 10 years ago by Eli Gazit - CEO, Softwear Suit Ltd
Avatar
I created the demo project u asked me to present the bug.
I sent it to the support email address.
Thanks.
Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
This turned out to be an issue with the RibbonGallery and is fixed in WPF Studio 2009.1 build 0500.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.