I am trying to use the tile brush to add a nice wood texture to my project. I have included a resource file, added the resource and selected the image from the ImageSource drop down. The image appears in the preview but throws an exception when I run the program.
This is the XAML code that has been added for the fill.
<Rectangle.Fill>
<ImageBrush ImageSource="pack://siteoforigin:,,,/Resources/WoodTexture.bmp" TileMode="Tile"/>
</Rectangle.Fill>
The exception that is thrown is this
A first chance exception of type 'System.Windows.Markup.XamlParseException' occurred in PresentationFramework.dll
Additional information: 'Provide value on 'System.Windows.Baml2006.TypeConverterMarkupExtension' threw an exception.' Line number '24' and line position '22'.
Does this have something to do with the way the resource has been loaded in, or am I referencing it wrong?