RibbonWindow causes multiple size events on maximize/restore

Ribbon for WPF Forum

Posted 12 years ago by Bjørnar Sundsbø - Norway
Version: 4.5.0484
Platform: .NET 3.5
Environment: Windows XP (32-bit)
Avatar
When using the RibbonWindow and performing a Maximize/Restore, layout is performed twice. This is a problem because I use a COM object on resize to generate a map image which fails when the first attempt is aborted when the second resize event fires.

Using a normal Window, this is not an issue. I expect this might be because the template is applied after the window is resized, which leads to a new resize when using the RibbonWindow.

To reproduce, simply create a RibbonWindow with the following addition to the codebehind:

protected override Size ArrangeOverride(Size arrangeBounds)
{
    Size size = base.ArrangeOverride(arrangeBounds);
    System.Diagnostics.Trace.WriteLine("ArrangeOverride " + size);
    return size;
}
If you add a usercontrol inside a grid and have it fill the window, and override the same method; the second time the event fires the size will have a difference of 8 pixels in both directions from the first event.

Is there a way I work around this until there is a new release with a fix for this issue?

- Bjørnar


[Modified at 02/25/2009 08:24 AM]


Bjørnar Sundsbø

Comments (3)

Posted 12 years ago by Bjørnar Sundsbø - Norway
Avatar
If I use the following XAML

<Grid>
    <Docking:DockSite x:Name="_dockSite" UseHostedAutoHidePopups="False" AutoHidePopupOpensOnMouseHover="False">
        <Docking:DockSite.AutoHideRightContainers>
            <Docking:ToolWindowContainer >
                <Docking:ToolWindow Title="Title" CanClose="False" CanDockRight="True" CanAutoHide="True" />
            </Docking:ToolWindowContainer>
        </Docking:DockSite.AutoHideRightContainers>
            <Docking:SplitContainer Width="Auto">
                <Docking:SplitContainer Docking:DockSite.ControlSize="350,500">
                    <Docking:Workspace Name="_workspace">
                        <Grid>
                            <b><WpfApplication1:UserControl1 Grid.Row="1" /></b>
                        </Grid>
                    </Docking:Workspace>
                </Docking:SplitContainer>
            </Docking:SplitContainer>
        </Docking:DockSite>
</Grid>
In a Window (UserControl1 is just a control with the ArrangeOverride mentioned in the initial post), I get a similar problem when Docking the autoHide ToolWindow (layout is performed twice). When undocking/setting back to autohide, the event is usually fired once. When Docking, it is fired twice, most of the time.

This bug manifest itself both in a normal Window and in a RibbonWindow.

- Bjørnar


Bjørnar Sundsbø

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Bjørnar,

Whenever you have more complicated questions like these that require setup, please just email our support address with a simple sample project showing a repro of the issue instead of posting here.

Can you make a sample project that shows the two problems and email it to us with a reference to this post?

Thanks, then we can take a look and debug it.


Actipro Software Support

Posted 12 years ago by Bjørnar Sundsbø - Norway
Avatar
Sample sent


Bjørnar Sundsbø

The latest build of this product (v2020.1.0) was released 18 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.