您的位置:首页 > 运维架构

Coproject - a RIA Caliburn.Micro demo, part 10.5

2015-09-03 06:39 399 查看
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.Cur
4000
rent.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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: