User Controls V.S. Custom Controls
I believe most of the WPF novices are quite confused with these two concepts at the beginning. (so was I). They are indeed not very clearly and distinguishably defined. Plus, the gray area between these two makes them even more ambiguous.
Well, I am gonna give my understanding of them in more programming perspective. I am not saying mine is absolutely correct. However, I am pretty confident that it is gonna help people start to choose the right one for proper use.
You can take it just as a composition of different other UI controls. As most of the WPF books said, the creation of a user control is very alike the creation of a window. You might be able to understand why I said that. As matter of fact, in the reality of programming, it really is. You have a XAML file and C# class file for a user control. The class file extends UserControl class, adds the additional behaviour and properties. The XAML file encapsulates the composing controls, the styles, the templates, animations and whatever necessary for “Look&Feel”. Since it is a just composition, it is really easy to create. It does not require you for too much knowledge of WPF UI model, as long as you are able to play brick game. :p
Oh yeah. This one you need to take deep breath for. :p. No, I am kidding. It is truly harder than the user control, but also truly cuter, because it gives you more space to play your magic. A custom control author must extend some certain UI controls, like Button or ItemsControl. You add the functions which you want for your control but the native one is lack of. Also you have to define the generic theme for your custom control. You store the theme as a ResourceDictionary and save it in Themes/Generic.xaml. Till then, you are done with your custom control. The creation of a custom control certainly requires you to have a better understanding of WPF UI model. You need to take some time to be really good at it.
Well, now comes the question of which one you should choose. The basic answer is I don’t know. :p. It is up to the scenario. If you are not satisfied with the original functions shipped by the native UI controls, you have to write your own custom control. But if you think each piece of the native controls is pretty good and you just need a big chunk of controls, you think about the user control. Please be advised that, since lots of things that custom controls can do can be done by user controls as well, considering the complexity of a custom control and the completion of the native controls shipped by WPF, I strongly suggest to always consider the user controls in the first place. Only if there is no possibility to reach your goal with the user control, otherwise, always choose user controls over custom controls.
Lately I have just figured out the summary about the differences between Custom Controls and User Controls. I could not say it is complete, but at least it offers the clearer criteria to choose which to develop.
1. The purpose of it is to enhance the existing control,
2. It supports theming for consumers, which means the consumers can style it in whatever way they like,
3. It is perfect to be 3rd-party control, especially because of point 2.
Whereas User Control
1. Its purpose is to compose controls into one piece,
2. It does not support theming for consumers. Therefore, the consumers can not restyle it,
3. It better stay with the consumer application in case the consumer needs to change its style somehow.
Generally & Simply speaking, custom controls have better flexibility and reusability than user controls