ribbon in a grid with row height: excepetion

Ribbon for WPF Forum

Posted 11 years ago by Liang Ma
Version: 12.2.0571
Platform: .NET 4.5
Environment: Windows 8 (64-bit)
Avatar
<ribbon:RibbonWindow 
    x:Class="RibbonTest.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"                                          
    xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
    xmlns:RibbonTest="clr-namespace:RibbonTest" Title="MainWindow" Height="350" Width="525">
    <Grid>

        <Grid.RowDefinitions>
            <RowDefinition Height="250"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <RibbonTest:RibbonView Grid.Row="0"/>
        
        <Grid Grid.Row="1" Background="Red"/>
    </Grid>    
</ribbon:RibbonWindow>

<UserControl x:Class="RibbonTest.RibbonView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
             mc:Ignorable="d" Loaded="RibbonView_OnLoaded">
<UserControl.Resources>
        <Style x:Key="ImageBackstageTabStyle" TargetType="ribbon:BackstageTab">
            <Setter Property="Header" Value="{Binding Header}"/>
            <Setter Property="KeyTipAccessText" Value="{Binding KeyTipAccessText}"/>            
        </Style>
    </UserControl.Resources>

    <ribbon:Ribbon>
        <ribbon:Ribbon.ApplicationMenu>
            <ribbon:Backstage ItemsSource="{Binding BackstageItems}" ItemContainerStyle="{StaticResource ImageBackstageTabStyle}">                
            </ribbon:Backstage>
        </ribbon:Ribbon.ApplicationMenu>
        <!--all tabs-->
        <ribbon:Ribbon.Tabs >
            <ribbon:Tab Label="Test" KeyTipAccessText="T">
                <ribbon:Group Label="Lock" FontSize="12">
                    <ribbon:StackPanel >
                        <ribbon:Button Label="xx"></ribbon:Button>
                        <ribbon:Button Label="YY"></ribbon:Button>
                    </ribbon:StackPanel>
                    </ribbon:Group>
            </ribbon:Tab>
            <ribbon:Tab Label="XX" KeyTipAccessText="U">
                <ribbon:Group Label="Lock" FontSize="12">
                    <ribbon:StackPanel >
                        <ribbon:Button Label="KK"></ribbon:Button>
                        <ribbon:Button Label="TES"></ribbon:Button>
                    </ribbon:StackPanel>
                </ribbon:Group>
            </ribbon:Tab>
        </ribbon:Ribbon.Tabs>
    </ribbon:Ribbon>
</UserControl>

Comments (2)

Posted 11 years ago by Liang Ma
Avatar

I found this bug 216-1759C0EF-0303 is still there in the latest version.

Could you please try one thing:

Run the test application and you will see there is a white space between the ribbon and red grid, could you please tell me how to remove the whilte space?Open the MainWindow.xaml, there is a grid with two rows and the height of first one is 250. If the height is less than 250, the ribbon will not be shown.If I set the height of the first row as Auto, then the ribbon displays just normal and ok, but when I use the shortcut key(ALT +F) two time, there will be an exception just like the description of issue 216-1759C0EF-0303

Could you please make sure I could get a solution for this problem? Otherwise I can’t release the application to my customer.

Thank you very much!

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Something was triggering a size update in Ribbon by a couple pixels when the Backstage opens.  We close key tip mode when that occurs more than a certain threshold.  I've increased the threshold for the next build to fix this.  I also updated the code where the exception occurs to not throw the exception if the scenario still did manage to occur.  If you need a preview build of the next maintenance release, please write us on your old ticket.


Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.