Seem to be having a lot of problems doing what should be simple things with XAML / WPF – I have created some XAML-based images using shapes like Rectangle and Ellipse to create icons which I need other parts of my application to use – but I cannot seem to find out how to do this – I seem to be able to store a Canvas in the Resource Dictionary but no way of using it in any other Window. How is this done – these are simple images just two or three shapes I want to use throughout my project!
The images must also be resizable – I know how to store paths, however these shapes contain gradient styles I want preserved plus I don’t know how the rectangle could convert to path and colour data.
Thanks!
You should use a Drawing and display it using a DrawingBrush like KP Adrian suggested or a DrawingImage and an Image control, but if you can’t use a drawing you can use a Canvas inside a VisualBrush.