Hi,
I have a Silverlight application that I am working on. I have a few different custom button styles that use a ContentTemplate to display an Image as a Button, such as:
<Style x:Key="CancelButtonStyle" TargetType="Button">
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Grid>
<Image Source="Assets/Images/Controls/cancel.png"/>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
cancel.png is a recently added image and it isn't showing. If I add a simple Image to a page with the source set to this image I get the underline in the XMAL design viewer with the warning
The file 'Assets/Images/Controls/cancel.png' is not part of the project or its 'Build Action' property is not set to 'Resource'
I've double checked and it's build action is set to 'Resource'. I've unloaded the project and viewed the csproj file and there is a build entry for this image, what have I missed? I haven't done anything different with this image that I have with other images in the same folder which work.
Update
If I use the following I can see the image at design time but not at runtime, any ideas?
<Image Source="Foo.Bar;component/Assets/Images/Controls/cancel.png" Stretch="None"/>