When to use UserControl vs. Control in Silverlight?
Posted
by Dov
on Stack Overflow
See other posts from Stack Overflow
or by Dov
Published on 2009-12-17T17:06:00Z
Indexed on
2010/03/26
13:23 UTC
Read the original article
Hit count: 494
I'm just getting my feet wet in Silverlight, and don't really understand the differences and pros/cons of creating a UserControl vs. creating a Control for the same task (as in when you right click on a selection in Expression Blend, for instance).
It seems like selecting "Make Into Control" just creates a new template for the base type you specify, whereas creating a UserControl creates a whole new base class. Is that correct?
In this particular instance, I'm creating a custom text box control that only takes numbers, and divides itself into 3 sections, storing 3 values into separate properties as pictured below. In this particular case, which would be best?
Update (Additional Question): Why can't I use Template Binding with a UserControl, but I can with a Control? That's one reason I thought that making a UserControl might not be the right decision.
© Stack Overflow or respective owner