D
D
Dmitry Olshak2017-05-14 19:58:41
.NET
Dmitry Olshak, 2017-05-14 19:58:41

How to properly store and use styles in WPF?

Hello! I am new to programming.
If I understand correctly, then styles for wpf are like css for html.
In that case, I have a question. Do I need to put all styles for elements into a separate xaml file (ResourceDictionary.xaml), including styles that are applied to one element, so as not to clutter up the main file with styling code? Or put in a separate file only those styles that apply to several elements?
Share your experience. How to store and use styles correctly?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Mikhail Usotsky, 2017-05-14
@dmitry_olshak

Well, I select for styles in a separate file or files (if various options are required). You can, of course, immediately in the main file. But this turned out to be impractical for me and makes it difficult to transfer to another project when I need the same style within a project. And besides, when all styles are stored in a separate file, you always know where to look for it and make a couple of edits if you don’t like something.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question