views:

132

answers:

1

I'm using WPF 4's (in .NET 4) ribbon control, version 3.5.40729.1, in my application. (Edit: I also tested the newly released version 4.0.0.11019 to no avail.) The application menu and all sub-menu popups align as far left as possible, usually far outside the ribbon window. The expected location is that the application menu's left edge aligns with the ribbon window's left edge, and that sub-menu popups will align with the left edge of the right (usually recent items) content pane.

Here's an example screen shot illustrating the issue I'm having. Note that the left edge of this screen shot is the left edge of my monitor.

alt text

Here's a snippet of code showing the XAML of the RibbonWindow root element and the beginning of the ribbon declaration (Although this issue occurs even for a new Ribbon Window project):

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto"/> <!-- ribbon goes here -->
        <RowDefinition Height="*"/>
        <RowDefinition Height="Auto"/>
    </Grid.RowDefinitions>

    <r:Ribbon Grid.Row="0">
        <r:Ribbon.ApplicationMenu>
            <r:RibbonApplicationMenu SmallImageSource="Resources/ribbon app menu.png"
                                     KeyTip="M">
                <r:RibbonApplicationMenuItem Header="New project" .../>

I was originally using a DockPanel and putting my ribbon in DockPanel.Dock = "Top", but based on a similar question (see below), I tested a Grid. However, nothing changed. Also, this is not an issue with left-to-right or right-to-left flow of the ribbon. I also just quickly checked the sample code, but it doesn't look like any magic properties are being set there to make the ribbon function correctly.

Is this a bug, or am I doing something wrong?

Can anyone reproduce this odd behavior?

Thanks you.

This is a similar issue to a question posted at http://stackoverflow.com/questions/1492400/wpf-ribbon-applicationmenu-alignment-on-the-right , however this question was asked about the older office-like ribbon, and the screen shot link posted there is no longer working, so I can't confirm 100% that the issue is the same as mine.

A: 

I wrote this sample ribbon its works fine (RTL), if u have a grid with multiple column set Grid.ColumnSpan as column counts. just FlowDirection is enough.

<ribbon:RibbonWindow x:Class="WpfApplication2.RibbonWindow1"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:ribbon="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary"
        Title="RibbonWindow1" 
        x:Name="Window"
        Width="640" Height="480" FlowDirection="RightToLeft">
    <Grid x:Name="LayoutRoot">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="342*" />
            <ColumnDefinition Width="276*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

         <ribbon:Ribbon x:Name="Ribbon" Grid.ColumnSpan="2" FlowDirection="RightToLeft">
            <ribbon:RibbonTab x:Name="HomeTab" 
                              Header="Home" FlowDirection="RightToLeft">
                <ribbon:RibbonGroup x:Name="Group1" 
                                    Header="Group1">

                </ribbon:RibbonGroup>

            </ribbon:RibbonTab>
        </ribbon:Ribbon> 
    </Grid>
</ribbon:RibbonWindow>
SaeedAlg
I'm not asking about Right-to-left. The application menu does not align with the left side of the ribbon window (etc) as it should. RTL is something different.
Benny Jobigan
Benny, if u can't understand its not my problem, I wrote this sample works fine for RTL, its more specific than LTR, also u referenced a sample in RTL concept, and I didn't find the same problem for myself, also i refer the related ribbon that i used because u didn't say what ribbon u used.
SaeedAlg
@SaeedAlg, I never asked about RTL, and although the question I said was similar does make mention of RTL, it ultimately says that it _didn't provide the desired results,_ just as it didn't for me. I did say I was using the WPF ribbon, though I did edit the question later to clarify exactly what ribbon I'm using. It is the same one you mentioned in your answer. Other than that I don't change `FlowDirection` to RTL in my example, it's the same as yours--yet the application menu in my application does not align with the window's left edge as it should. It's a strange problem.
Benny Jobigan
@Benny i didn't have a same problem, I attached a sample which works fine for me. there was a WPF Ribbon in codeplex (very similar to this ribbon), but i can't understand why downvote, if no help, its related to ur other system settings or etc, because too many people using this ribbons and non of them have a same problem. Also i just highlight the Grid.ColumnSpan not RTL or etc, but if its not ur answer steel i can't understand why down vote.
SaeedAlg