Using a usercontrol (splitbutton) in the ribbonbar

Ribbon for WPF Forum

Posted 14 years ago by Arthur Damen
Version: 9.2.0510
I have a usercontrol that contains a Actipro Splitbutton which I want to embed into my actipro ribbonbar.

Copying the code directly into the ribbonbar works fine.
However, when I add the usercontrol to the ribbonbar, it shows the openstate, and not the splitbutton. Do I have to do some extra things to get a custom usercontrol into the ribbonbar which behaves the same as when i copy the code directly into the ribbonbar?

<UserControl x:Class="NdsTransitionControl"
    xmlns:x=""  Focusable="False">
    <Grid HorizontalAlignment="Left" VerticalAlignment="Top" >
        <ribbon:SplitButton Label="Transition" HorizontalAlignment="Left" VerticalAlignment="Top" >
          <ribbon:PopupGallery Name="PageTransitionGallery"  InitialColumnCount="7" >
                    <x:Array Type="{x:Type Image}">
                        <Image ribbon:PopupGallery.Category="No Transition" Source="{x:Static SomeResourceLink:somepicture}"></Image>
                        <Image ribbon:PopupGallery.Category="Faders" ToolTip="Fade In"   Source="{x:Static SomeResourceLink:somepicture}"></Image>
                        <Image ribbon:PopupGallery.Category="Faders" ToolTip="Dissolve"  Source="{x:Static SomeResourceLink:somepicture}"></Image>
                        <Border Margin="2" BorderBrush="#808080" BorderThickness="1"  Width="40" Height="40" SnapsToDevicePixels="True">
                            <Image Source="{Binding Path=Source}" Stretch="None" HorizontalAlignment="Center" VerticalAlignment="Center" SnapsToDevicePixels="True" />

Comments (4)

Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Arthur,

Ribbon has special code that will collapse built-in ribbon controls to different variant sizes depending on available width. However if you embed those ribbon controls within a UserControl, you will prevent that functionality from working.

Actipro Software Support

Posted 14 years ago by Arthur Damen
The usercontrol itself has no width/height specified. So the container where this control is located into should be able to resize it automatically.
Posted 14 years ago by Arthur Damen
What I did now is the following:

Instead of the splitbutton and popupgallery I now added only the popupgallery in the usercontrol. The splitbutton is in the ribbonbar. This way it works.

 <ribbon:SplitButton >
   <base:TransitionControl ></base:TransitionControl>
Posted 14 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Arthur,

If you think there is a problem with the UserControl sizing, please email us a simple sample project that shows the issue and we'll be happy to take a look. Thanks.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.