Search code examples
c#wpfcrashwindows-xpribbon

Reusing Image on Ribbon Causes Crash on XP


I am using a WPF ribbon and I have just run into some strange behavior. I have a contextual tab which I duplicate some of the functionality from the Home tab so that my users don't have to click back and forth.

The problem I have seen is that if I reuse an image, my application crashes on start up if running on Windows XP. There is no issue on Windows 7. Any ideas?

Code:

<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>-->

If I take out the LargeImageSource/SmallImageSource part it works fine.


Solution

  • Not sure if this would help you.

    It happened me some time with something similar with my app crashing on WinXP. It turns out the Icon I used for my Windows. It seems that full colored, transparent, big icons are not correctly handled by XP systems. Changed to small non-transparent images and it started to work.