Coproject - a RIA Caliburn.Micro demo, part 10.5

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 forumSilverlight toolkit issueAppsolo 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.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值