I am using ActiPro Docking and Ribbon. I have noticed that after clicking on the Ribbon PopupButton, there is a significant delay when the window is resized, or when switching to a different docking window. Clicking on a Ribbon Button does not lead to such a delay--only the PopupButton. I believe the delay is tied to the fact that my window contains a DataGrid with thousands of rows that are virtualized. However, this large DataGrid does not experience any such delay if the PopupButton has not been clicked.
To reproduce the problem, I started with a fresh WPF Application in VS 2010. Here is the code for MainWindow.xaml
<ribbon:RibbonWindow
x:Class="RibbonPopupProblem.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:shared="http://schemas.actiprosoftware.com/winfx/xaml/shared"
xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon"
xmlns:docking="http://schemas.actiprosoftware.com/winfx/xaml/docking"
Title="MainWindow"
Height="350" Width="525" >
<DockPanel LastChildFill="True" >
<DockPanel DockPanel.Dock="Top" >
<ribbon:Ribbon
x:Name="ribbon"
UseScenicLayout="False" >
<ribbon:Ribbon.Tabs >
<ribbon:Tab Label="TestTab" >
<ribbon:Group Label="TestGroup" >
<ribbon:Button Label="Simple Button 1" Margin="7"/>
<ribbon:Button Label="Simple Button 1" Margin="7"/>
<ribbon:PopupButton Label="Popup Button 1" Margin="7">
<StackPanel>
<Label>Dummy 1</Label>
<Label>Dummy 2</Label>
<Label>Dummy 3</Label>
</StackPanel>
</ribbon:PopupButton>
</ribbon:Group>
</ribbon:Tab>
</ribbon:Ribbon.Tabs>
</ribbon:Ribbon>
</DockPanel>
<DockPanel LastChildFill="True" DockPanel.Dock="Bottom" >
<docking:DockSite DockPanel.Dock="Right" x:Name="MainDockSite"
ItemContainerRetentionMode="Wrapped"
CanToolWindowsAutoHide="False"
CanDocumentWindowsRaft="False"
CanToolWindowsRaft="False">
<docking:Workspace x:Name="MainWorkSpace">
<docking:TabbedMdiHost>
<docking:TabbedMdiContainer>
<docking:DocumentWindow Title="Test Window 1">
<Grid>
<DataGrid
x:Name="TestDataGrid1"
AutoGenerateColumns="True"
EnableRowVirtualization="True"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling" />
</Grid>
</docking:DocumentWindow>
<docking:DocumentWindow Title="Test Window 2">
<Grid>
<DataGrid
x:Name="TestDataGrid2"
AutoGenerateColumns="True"
EnableRowVirtualization="True"
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Recycling" />
</Grid>
</docking:DocumentWindow>
</docking:TabbedMdiContainer>
</docking:TabbedMdiHost>
</docking:Workspace>
</docking:DockSite>
</DockPanel>
</DockPanel>
</ribbon:RibbonWindow>
And here is the code-behind
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using ActiproSoftware.Windows.Controls.Ribbon;
namespace RibbonPopupProblem
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : RibbonWindow
{
public List<DataItem> _dataItems1 = new List<DataItem>();
public List<DataItem> _dataItems2 = new List<DataItem>();
public MainWindow()
{
InitializeComponent();
for (int i = 0; i < 30000; i++)
{
_dataItems1.Add(new DataItem { x = i * 2 });
_dataItems2.Add(new DataItem { x = -i * 6 });
}
TestDataGrid1.ItemsSource = _dataItems1;
TestDataGrid2.ItemsSource = _dataItems2;
}
}
public class DataItem
{
public Double x { get; set; }
public Double y { get { return x / 5; } }
}
}
Test 1: Start the application. Do not click on any ribbon buttons. Maximize the window. On my computer, this seems to take less than half a second. Close the application.
Test 2: Start the application. Click on Simple button 1. Maximize the window. On my computer, this seems to take less than half a second. Close the application.
Test 3: Start the application. Click on the PopupButton. Maximize the window. On my computer, this seems to take more than 3 seconds. Close the application.
Test 4: Start the application. Do not click on any ribbon buttons. Switch to Test Window 2. On my computer, this seems instant Close the application.
Test 5: Start the application. Click on Simple button 1. Switch to Test Window 2. On my computer, this seems instant. Close the application.
Test 6: Start the application. Click on the PopupButton. Switch to Test Window 2. On my computer, it seems to take more than 1 second. Close the application.
Of course, this is a stripped-down project to demonstrate the problem. The delays are a bit more significant in my real project.