I am using ribbon controls (
RibbonControlsLibrary.dll) and trying to use one image file between different controls.
I have around ten different projects in a solution. Each of these projects currently have 'Images' folder. Since most of these images are same, i was trying to create a new project with all the images file in the resource and then reference to the all the other projects. It would have worked if I didnt have ribbon control but with ribbon control i get runtime error.
But, interesting part it, I can see my icon/image on xaml designer and when i change the image name on xaml, the designer will update with correct image from the resources, but i get run-time error".
Code sample:
Ref:
xmlns:res="clr-namespace:ResourceLibrary;assembly=ResourceLibrary"
<
r:Ribbon Grid.ColumnSpan="2" Grid.Row="0">
<r:Ribbon.Resources>
<r:RibbonCommand x:Key="cmdOpen"
Executed="RibbonCommand_Executed"
LabelTitle="Open"
LabelDescription="Open project."
LargeImageSource="/ResourceLibrary;component/Resources/myimg.gif"
SmallImageSource="/ResourceLibrary;component/Resources/myimg2.gif"/>
.....
.....
</r:Ribbon.Resources>
</r:Ribbon>
Then it is called as:
<r:RibbonTab Label="Project">
<r:RibbonGroup>
<r:RibbonGroup.Command>
<r:RibbonCommand LabelTitle="Project" />
</r:RibbonGroup.Command>
<r:RibbonButton Command="{StaticResource cmdOpen}"/>
.........
</........>