What are the advantages and disadvantages of resource dictionaries and user controls for organizing large xaml files?

I know that there are a number of questions that say that both resource dictionaries and user controls can be used to split and organize large xaml files, but none of them seem to use the pros and cons of using each other.

My question is, what are the pros and cons of using resource dictionaries and user controls to organize large xaml files?

+3
source share
2 answers

UserControl ( ), . , ​​ , , , Person, PersonToDisplay. , UserControl, .

ResourceDictionary, . , , ( ), ResourceDictionary.

, , , , , , . , , , , ( ) <local:AnnoyingButton />, <Button Style="{StaticResource AnnoyingButton}" /> ( AnnoyingButton.xaml ), . , () , , , () ResourceDictionary.MergedDictionaries. , .

+6

: ResourceDictionaries DataTemplates, ControlTemplates, Style ValueConverters, TemplateSelectors UserControls, "" ( ) , ResourceDictionaries .

ResourceDictionaries , , , , "Visual Elements " - . , DataTemplates, Styles ControlTemplates , - . ValueConverters TemplateSelectors ( ) , , ResourceDictionary.

, .

+2

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


All Articles