What is the standard way to store and display xaml icons?

I started using xaml-based icons in my WPF application, but I am trying to find an easy way to store and share them. Icons - DrawingBrushes.

I AM?

A) Store each icon in its own xaml file, enclosed in a resource dictionary. This means that I either have to load each icon resource every time, or I want to create a standard "sign" dictionary that pulls out every xaml file. This seems to be a pain that needs to be supported, and I still have to insert the icon resource dictionary every time I want to use the icon.

If I went for it, how do people usually display an icon? Just a canvas with a brush as a background?

B) Store each icon in its own xaml file as a UserControl. This makes it easy to display the icon dead - just draw a suitable control and it might be easier to declare the XML icon namespace at the top of your XAML rather than combining a resource dictionary.

C) Store all the icons in a single XAML file wrapped in a resource dictionary. One dictionary to merge, but without the support of drawing individual files into this dictionary. Potentially inconvenient to edit icons, though.

D) ....?

How do other people manage their icons?

+4
source share

Source: https://habr.com/ru/post/1397044/


All Articles