2
我正在使用WPF功能區,我剛剛遇到了一些奇怪的行爲。我有一個上下文選項卡,可以從「主頁」選項卡複製一些功能,以便我的用戶不必前後點擊。重新使用功能區上的圖像在XP上導致崩潰
我看到的問題是,如果我重新使用圖像,我的應用程序在啓動時崩潰,如果在Windows XP上運行。 Windows 7沒有問題。有什麼想法?
代碼:
<r:RibbonTab Header="Home">
<r:RibbonGroup Header="Clipboard">
<r:RibbonButton Label="Paste" LargeImageSource="Resources\Images\Paste.ico" Command="{Binding PasteCommand}"/>
<r:RibbonButton Label="Cut" SmallImageSource="Resources\Images\Cut.ico" Command="{Binding CutCommand}"/>
<r:RibbonButton Label="Copy" SmallImageSource="Resources\Images\Copy.ico" Command="{Binding CopyCommand}"/>
</r:RibbonGroup>
.... Other Code...
<r:RibbonTab Header="Options" ContextualTabGroupHeader="Options">
<r:RibbonTab.Style>
<Style TargetType="r:RibbonTab">
<Style.Triggers>
<Trigger Property="Visibility" Value="Visible">
<Setter Property="IsSelected" Value="True" />
</Trigger>
</Style.Triggers>
</Style>
</r:RibbonTab.Style>
.... If I uncomment this next part it crashes on XP....
<!--<r:RibbonGroup Header="Clipboard">
<r:RibbonButton Label="Paste" LargeImageSource="Resources\Images\Paste.ico" Command="{Binding PasteCommand}"/>
<r:RibbonButton Label="Cut" SmallImageSource="Resources\Images\Cut.ico" Command="{Binding CutCommand}"/>
<r:RibbonButton Label="Copy" SmallImageSource="Resources\Images\Copy.ico" Command="{Binding CopyCommand}"/>
</r:RibbonGroup>-->
如果我拿出它工作正常的LargeImageSource/SmallImageSource一部分。
我可以試試。奇怪的是,雖然它工作正常,除非我使用相同的圖像兩次。它就像嘗試訪問圖片或其他東西時會發生衝突。不知道爲什麼。 – KrisTrip 2012-02-02 18:47:42
我更改了我用於PNG的ico,它現在可以正常工作 – KrisTrip 2012-02-08 14:35:08
重要提示:o) – NestorArturo 2012-02-08 16:26:16