WPF: CustomControls vs UserControls

In WPF, what are the differences between CustomControls and UserControls? When should I use each?

+3
source share
1 answer

UserControl (Composition):

  • Contains several existing controls in a reusable "group"
  • Consists of XAML and code file
  • Cannot use style / templates
  • Conclusion from UserControl

CustomControl (extension of an existing control)

  • Extends an existing control with advanced features
  • Contains a code file and a default style in /Generic.xaml themes
  • May be in style / pattern
  • The best approach to building a library control

: CustomControls UserControls

+4

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


All Articles