c#/ WPF的快速性能问题。WPF Rectangle.Fill方法响应
我有以网格的矩形:
<Rectangle Name="NewPage" Grid.Row="1" Width="42" Height="59.4" Stroke="Black" MouseEnter="Rectangle_MouseEnter_1" MouseLeave="NewPage_MouseLeave_1" />
,我使用上的MouseEnter和鼠标离开执行填充:
private void Rectangle_MouseEnter_1(object sender, MouseEventArgs e)
{
SolidColorBrush blueBrush = new SolidColorBrush();
blueBrush.Color = Colors.Blue;
NewPage.Fill = blueBrush;
}
private void NewPage_MouseLeave_1(object sender, MouseEventArgs e)
{
SolidColorBrush whiteBrush = new SolidColorBrush();
whiteBrush.Color = Colors.White;
NewPage.Fill = whiteBrush;
}
所期望的目标是突出矩形作为鼠标移动在此之后,稍后再点击一下即可完成更多工作。
我遇到的问题是填充方法的响应性。填充前,我可以将鼠标移过矩形。它也不会在开始应用程序后约15秒钟开始充满。
任何有关这方面的提示/指导将不胜感激。
谢谢!
只是将它复制到一个新的项目,这对我来说似乎很好。 – kenny 2013-02-14 20:27:12
好的。这是否意味着问题可能与本地硬件有关?这项任务会占用那么多的处理能力吗?或者他们的项目设置需要在某个地方进行定制以提高性能? – berniefitz 2013-02-14 20:29:02
有没有可能通过远程桌面或VNC连接?或者在UI线程上运行一些计算密集型的东西? – Whyaduck 2013-02-14 20:31:52