Actipro RibbonWindow and slow Startup of application?

Ribbon for WPF Forum

Posted 13 years ago by Arthur Damen
Version: 10.2.0532
Avatar
Hi,
I have a ribbonwindow (Visual Studio 2010) application that takes about 10 seconds to start. Is there anyone who had the same experience and knows what to do about this?

It's very hard to say where this happens.
I only show a ribbonwindow and do some initialization. There's no network traffic of something related to that...

Comments (15)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Arthur,

It could just be .NET loading the Ribbon, Shared and any of your own assemblies that are used. Once they have been loaded once I would imagine that everything would start up very quickly.

Note that all the native Microsoft WPF assemblies also add to this initial load time.

[Modified at 11/18/2010 03:35 PM]


Actipro Software Support

Posted 13 years ago by Arthur Damen
Avatar
Hi,

It doesn't matter if I load it the first time or the second or the....
Always the same speed...

I too suspect .Net.
I found out until now that setting the
ActiproSoftware.Windows.Themes.CommonThemeName.Office2007Blue
as my current style at startup takes 2 seconds more to start the application.
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Arthur,

What if you set one of the 2010 styles. Are those faster? The 2007 styles load the 2007 brushes, then the core 2010 styles, and finally some small overrides for styles to make them more 2007-ish.


Actipro Software Support

Posted 13 years ago by Arthur Damen
Avatar
That's a good suggestion.

I wil check that.

Thanks.
Posted 13 years ago by Arthur Damen
Avatar
We made a test and the startup of the application went from
11.9 seconds to 8.9 seconds.

So we improved 3 seconds with the new style.
Posted 13 years ago by Nam
Avatar
Hello,

I had the same Slow-Startup problem and I have to work around as following:

protected override void OnStartup(StartupEventArgs e) {
    base.OnStartup(e);
    var demoWindow = Application.LoadComponent(new Uri("MainWindow.xaml", UriKind.Relative)) as Window;

    // Start-Uncomment this to load faster.
    // demoWindow.Width = 50;
    // demoWindow.Height = 50;
    // End-Uncomment this to load faster.

    ThemeManager.CurrentTheme = "Office2007Black";
    demoWindow.Show();

    // Restore desired size.
    demoWindow.Width = 800;
    demoWindow.Height = 700;

}
@Actipro: I want to send you the sample source code but don't know where to add an attachment.

[Modified at 12/02/2010 09:51 PM]
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Nam,

You can email us at our support address.


Actipro Software Support

Posted 13 years ago by Nam
Avatar
Hi Actipro

I sent you the sample project this morning. Please give us feedback once you solve the issue.

Thank you,
Nam
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Nam,

A couple things...

1) You were setting ThemeManager.CurrentTheme in both the MainControl and App code. Setting it in the App code is where you want to do it.

2) Also note that in Ribbon the default styles used match Office 2010 now. The 2007 styles take a little longer to work since they are loaded on top over and merge into the Office 2010 styles. So if you set a 2010 theme instead of 2007 it will go faster.

We'll look to see if we can improve that for the future.


Actipro Software Support

Posted 13 years ago by Nam
Avatar
Hi Actipro,

1. Thank you for your fast answer. I removed the setting ThemeManager.CurrentTheme in the MainControl & set the theme to Office2010 but it does not improve the loading time much.

2. Could you check why when we set the size to 50x50 before showing the window, it will load very much faster? Is it a bug?

Thank you,
Nam
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Nam,

When the window is that size the ribbon is collapsed and won't take part in measurement. My guess is that there are several measure cycles going on during load time too so what your trick does effectively skips over them.

You could alternatively just do Visible="Collapsed" on the Ribbon in XAML and then after it's loaded, make it visible again. That would accomplish the same thing.


Actipro Software Support

Posted 13 years ago by Arthur Damen
Avatar
I have been testing with visibility but that does not increase/decrease the time needed to start in my situation.
Posted 13 years ago by Nam
Avatar
Does it work if you use the work-around I described above?
Posted 13 years ago by Arthur Damen
Avatar
decreasing the size does not give me any change in starttime.
Maybe you have some controls that are started in the Load phase, which is not triggered when not shown.
Posted 13 years ago by Nam
Avatar
Hi,

Sorry for the late answer.

In the sample I sent to Actipro support, I was using the sample code extracted from Samples installed together with Actipro. So there is no special thing there. You can check the source code (My ticket number is [159-148B5F02-1941])

Thank you,
Nam
The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.