Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vertical separator in WPF Ribbon

How can I add Vertical separator to WPF Ribbon, to RibbonGroup? I have tried something like that, but i got horizontal separator istead of vertical.

<r:RibbonGroup>
<r:RibbonButton Command="{StaticResource SomeButton}" />     
 <r:RibbonSeparator></r:RibbonSeparator> 
 <r:RibbonToggleButton IsChecked="False" Command="{StaticResource AnotherButton}"/></r:RibbonToggleButton>
 </r:RibbonGroup>

So how can I make vertical separator?

like image 806
Marta Avatar asked Jun 07 '10 13:06

Marta


3 Answers

You can wrap what you have in a RibbonGroup, a vertical separator is created to the right of the group.

Vertical Ribbon Separator using RibbonGroup as wrapper

All I did was wrapped the first button in a RibbonGroup.

<ribbon:RibbonTab x:Name="HomeTab" 
                  Header="Home">
    <ribbon:RibbonGroup x:Name="Group1" 
                        Header="Group1">
        <ribbon:RibbonGroup>
            <ribbon:RibbonButton x:Name="Button1"
                             LargeImageSource="Images\LargeIcon.png"
                             Label="Button1" Margin="-5" />
        </ribbon:RibbonGroup>

        <ribbon:RibbonButton x:Name="Button2"
                             SmallImageSource="Images\SmallIcon.png"
                             Label="Button2" />
        <ribbon:RibbonButton x:Name="Button3"
                             SmallImageSource="Images\SmallIcon.png"
                             Label="Button3" />
        <ribbon:RibbonButton x:Name="Button4"
                             SmallImageSource="Images\SmallIcon.png"
                             Label="Button4" />
    </ribbon:RibbonGroup>

</ribbon:RibbonTab>
like image 64
E-rich Avatar answered Sep 29 '22 01:09

E-rich


Works with me-

                <my:RibbonSeparator Margin="5,0" Width="70" BorderBrush="Navy" BorderThickness="2">
                    <my:RibbonSeparator.RenderTransform>
                        <RotateTransform Angle="90" />
                    </my:RibbonSeparator.RenderTransform>
                </my:RibbonSeparator>
like image 45
Ravi Avatar answered Sep 29 '22 00:09

Ravi


It looks like this doesn't work in the latest version (3.5.40729.1) anymore. The RibbonSeparator also doesn;t work, but you can use:

<Ribbon:RibbonControlGroup Height="55" Margin="5" Width="1" MinHeight="55" MaxWidth="1"/>
like image 42
Christo Avatar answered Sep 29 '22 02:09

Christo