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