2010-03-02 71 views
3

對,所以我的桌面上的以下非常非常簡單的代碼,掛起/凍結編制和框架3.5WPF字號風格掛起/凍結/停止響應

<Window x:Class="WpfApplication1.Window1" 
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
Title="Window1" Height="300" Width="300"> 
<Window.Resources> 
<ResourceDictionary> 
    <Style x:Key="s1" TargetType="{x:Type TextBlock}"> 
     <Setter Property="FontSize" Value="10"></Setter> 
    </Style> 
</ResourceDictionary> 
</Window.Resources> 
<Grid> 
    <TextBlock Text="adfasdf" Style="{StaticResource s1}"></TextBlock> 
</Grid> 
</Window> 

問題在這裏運行的時候,據我我知道是應用於控件的樣式中的FontSize。當我刪除它時,它很好。

如果我在同一臺機器上的framework 4.0中編譯它,它可以工作。

它適用於我的筆記本電腦,可能是其他人的機器,只是不在我的桌面上。

任何幫助表示讚賞

回答

0

第一印象是咦?有趣。如果您啓動VS的另一個實例,請附加到掛起的進程,然後單擊Debug -> Break All,您會看到什麼?

+0

鏈接調用堆棧顯示 PresentationCore.dll中!MS.Internal.FontCache.HashTable.Lookup(MS.Internal.FontCache.IFontCacheElement E,布爾補充)+ 0x8d字節 – Jonathan 2010-03-02 12:21:20

+0

根據我的時候停止,有時它是進一步如下所示 PresentationCore.dll!MS.Internal.FontCache.ElementCacher.Mapping.get()+ 0x33字節 – Jonathan 2010-03-02 12:22:47

+0

似乎有一個無盡的循環 – Jonathan 2010-03-02 12:24:16