我有一個使用mahapp.metro進行造型的小型WPF應用程序。窗口中有7個文本框,其代碼與下面的示例類似。當我運行應用程序時,如果可能的話,它會佔用很多CPU,超過90%。當我刪除控件時:TextBoxHelper.IsWaitingForData =「True」,cpu使用率下降到幾乎0%,我一直沒能找到任何問題。 TextBoxHelper.IsWaitingForData的真正含義是什麼?控件是什麼:TextBoxHelper.IsWaitingForData做什麼?
<Canvas Grid.Column="0" Grid.Row="1">
<TextBox x:Name="SecurityStatusTextBox" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" IsReadOnly="True" Text="{Binding SelectedSecurityStatus, Mode=OneWay}"
Margin="50,50,0,0" Height="50" Width="250" FontSize="16"
controls:TextBoxHelper.ClearTextButton="True"
controls:TextBoxHelper.IsWaitingForData="True"
controls:TextBoxHelper.UseFloatingWatermark="True"
controls:TextBoxHelper.Watermark="{x:Static properties:Resources.SecurityStatus}"/>
<TextBox x:Name="BagTypeTextBox" HorizontalAlignment="Left" TextWrapping="Wrap" VerticalAlignment="Top" IsReadOnly="True" Text="{Binding SelectedBagType, Mode=OneWay}"
Margin="325,50,0,0" Height="50" Width="250" FontSize="16"
controls:TextBoxHelper.ClearTextButton="True"
controls:TextBoxHelper.IsWaitingForData="True"
controls:TextBoxHelper.UseFloatingWatermark="True"
controls:TextBoxHelper.Watermark="{x:Static properties:Resources.BagType}"/>
</Canvas>
請記得投了有用的答案:) http://stackoverflow.com/help/privileges/vote-up – mm8