Minimal images and shapes defined by XAML?

Is it good practice to build your user interface with minimal images and define things like shapes / paths etc. in xaml?

If so, what are the benefits of this approach and / or other approaches?

+4
source share
1 answer

In my opinion, creating user interfaces in WPF over the last 7 years, yes, that’s good practice in general. However, it completely depends on the aesthetics you want to provide. Static images add to the size of your application, but can be easily cached, making them workable. They are a little inflexible because the image distorts the second one you are trying to stretch in size. Images are great if you don't need dynamic size.

However, you will find that defining your user interface entirely with markup can be much more complicated and may deviate from your ideal layouts with pixels of different sizes. Gradients created in WPF are of poor quality, you will see a visible strip if the gradient is too far.

Performance does not play a big role if you are not going to use a lot of DropShadowEffects (do not use outdated BitmapEffects). When using template controls, attach to lightweight elements (such as FrameworkElement ).

By the way, there is a fantastic and recently free icon studio called Syncfusion Metro Studio 1 , which has a rather extensive set of icons that allows you to adjust the size, background, foreground and addition, then it allows you to choose whether you want to save it as an image or export it like the xaml path. The advantage of using XAML paths is that they are perfectly scalable and you can dynamically change the fill color that the user can even set. Something that is possible with images using a custom color overlay shader, but very resource intensive.
+2
source

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


All Articles