How to share vector icon while being able to change Fill brush

87 Views Asked by At

In .Net 4.6, I use shared vector icons implemented as Path in Canvas in a global xaml like this:

<ResourceDictionary ...>
    <Canvas x:Key="mSearchCanvas" x:Shared="False" Width="24" Height="24">
        <Path Data="M9.5,3A6.5,6.5 0 0,1 16,9.5..." Fill="Black" />
    </Canvas>
</ResourceDictionary 

I can then reuse these icons in several applications using:

<Viewbox Width="16" Height="16" Child="{StaticResource mPencilCanvas}"/>

It works well but I'd like to use the same icon/Canvas with different Fill brushes.

Is there a simple way to override Fill property with new value?

0

There are 0 best solutions below