How to provide the link to vector icon into resourcedictionary?

158 viewsc++resourceswpfxamlc++ resources wpf xaml
0

I’m trying to use vector images in my wpf application. I have an icon “ic_document.xaml” in “Resources” folder, here it is:

<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" Name="Svg63" Width="50"
    Height="50">
  <Canvas Name="Sf1">
    <Path xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Name="Path2" Fill="#000000"
          Data="M 7 2 V 48 H 43 V 14.59 l -0.28 -0.31 -12 -12 L 30.406 2 Z M 9 4 H 29 V 16 H 41 V 46 H 9 Z M 31 5.4375 39.5625 14 H 31 Z" />    
   </Canvas>
</Canvas>

icon in Folder

I know that if I want to use it in my application then I should create a “ResourceDictionary” and then just copy-paste this code to it. But can I do it more simply and just provide the link to ic_document.xaml ? Something like this

<ResourceDictionary xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
  <Canvas x:Key="IcTest">
     //Link to ic_document.xaml
  </Canvas>
</ResourceDictionary>

How can I do it?