Coproject - a RIA Caliburn.Micro demo, part 10.5

by Augustin Šulc

If you watched CPU usage after implementing BusyIndicator, you might notice major increase in CPU usage on To do module after the list is loaded for the first time.

High CPU usage with BusyIndicator and ProgressBar

It is a common issue with BusyIndicator: Silverlight forum, Silverlight toolkit issue, Appsolo blog but the solution is not obvious or easy to find. So I’ve spent some time and figured out that the excessive CPU usage is caused by ProgressBar that is present in BusyIndicator. After googling for a while, I ran into this forum but that was all about it. Fortunately, recently I saw Silveright TV episode 57. I strongly recommend to watch the video.

Now, let's apply the new knowledge on Coproject. Edit App.xaml.cs

private void Application_Startup(object sender, StartupEventArgs e)
{
	Application.Current.Host.Settings.EnableRedrawRegions = true;
}

Run the application and reload the list (be careful if you have epilepsy!). As you can see, we have a problem.

Now, let's do what was suggested in the video. So, edit ShellView to begin as follows:

<Grid x:Name="LayoutRoot">
	<Border Style="{StaticResource ContentBorderStyle}">
		<ContentControl Style="{StaticResource LogoIcon}"/>
	</Border>
	<Border Style="{StaticResource LeftBorderStyle}"/>

	<TextBlock Text="Coproject" Style="{StaticResource ApplicationTitleStyle}" />
	...

And then just update LeftBorderStyle in Custom.xaml:

<Style x:Key="LeftBorderStyle" BasedOn="{StaticResource LinksBorderStyle}" TargetType="Border">
	<Setter Property="Margin" Value="10,135,25,0"/>
</Style>

Run the application again and you should see we're fine now.

Tags: Silverlight, Coproject, bug, Caliburn

3 Comments

  • Albert van Peppen said

    Hi, first of all: great articles!

    Next I have some remarks/questions;
    Firstly, can you Tag this tutorial episode 10.5 on CaliBurn as well; I totally missed the 10.5 because I have been walking the tutorial on the Caliburn Tag :)

    Secondly, I don't see how your given solution makes everything fine;
    When I apply your changes, the ShellView seems ok now, but when you hover the 'menu'-list you'll see the colors appearing on the list items.
    When selecting the ToDoListsView you also see that this view is totally sick ( :) ) as well..

    Can you explain why this is?

    Keep up the great work!

  • Albert van Peppen said

    Please ignore the second point in my previous post; I was still not awake and the coffee was still in the cup...
    Ofcourse the coloring is there; you have turned on some debugging features that just do that to indicate what's happening..

    Sorry for the stupid question :(

  • Augustin Šulc said

    @Albert: Thank you for the tip about Caliburn tag. It should be fixed now.
    No problem about your other question - it happens to all of us ;-)
    I hope that despite this misunderstanding, the tutorial helped or at least inspired you...

Add a Comment