Changing the title of Ribbon Window is taking much time

Ribbon for WPF Forum

Posted 12 years ago by Ravi Kumar
Avatar
I have a ribbon window for which, the title should be changed based on the context. On firing an event inside the window, I am setting the ApplicationName of the window to the required string and it worked. But the line of execution is itself taking 2 seconds to just change the title of the window. Does changing a title involve much things to perform? Or am I using this in wrong way?

Here is my code to set the title (ApplicationName):

string title = "My Title";
//some code to set the 'title' object.
this.ApplicationName = title;

I have used a profiler and found that the above line (last line) itself is taking 2 seconds.

Thanks in advance for your help,
Ravi Kumar

Comments (3)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Ravi,

When I try it in the demo it changes instantly. Changing the ApplicationName does cause a title bar rearrange but still, that should occur near instantly, even if you have QAT items, and contextual tab groups visible. All those are visible when I'm testing in the demo.

Here is the test code I put in MainControl.xaml.cs in our demo:
private void applicationHelpCommand_Execute(object sender, ExecutedRoutedEventArgs e) {
    RibbonWindow window = (RibbonWindow)ActiproSoftware.Windows.Media.VisualTreeHelperExtended.GetAncestor(ribbon, typeof(RibbonWindow));        window.ApplicationName = new string('m', (int)(new Random().NextDouble() * 50));
}
I can hold down F1 while that window is displayed and I see the title bar constantly rearranging, which is correct and means it's running fast.

If you can duplicate this issue in our sample, or in a project of your own, please email the repro to us so we can look at it. Thanks!


Actipro Software Support

Posted 6 years ago by Piyush Parsai
Avatar

Hi Actipro,

I’m facing exactly the same issue as mentioned in the first comments.
Both the logger statements and Visual Studio profiler are showing me the particular line of code (this.ApplicationName = ) in my application is taking unusually high time.

On first launch of my window which is using RibbonWindow it’s taking 4.7 sec and on further subsequent launches it is taking 1.2 sec

I’m trying to get this reproduced in samples but till then can you give me some hints / best practice to set ApplicatioName i.e. should it be set in some event etc.

Also have other users faced same problem and what were the suggestions given to them?

I have the VS profiler screenshot but not sure how to upload it

[Modified 6 years ago]

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

Hi Piyush,

I don't believe we ever received a sample related to this.  If you can make one, please do and send it to our support address.  Reference this post and rename the .zip file extension so it doesn't get spam blocked.

Per our previous post, we haven't seen a slowdown.  If you see a scenario where the first time it's taking longer than later, it could just be that the .NET assemblies are loading up the first time since they all JIT (just in time) load.  Still, 1.2 seconds to update the title seems way too high.  When we tested ApplicationName updates, they went through instantly.


Actipro Software Support

The latest build of this product (v2019.1 build 0681) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.