Creating Lookless Controls for WPF and Silverlight

Sign in to queue

The Discussion

  • User profile image

    This is a great presentation to distinguish from User Control to Custom Control

  • User profile image

    I am confused on how to make a Custom Control from User Control. Do I first make a User Control with all the limited functionalities, and then, make the Custom Control from that to add those data binding and style functionalities?


    Is there a screencast for that? Thank you.

  • User profile image

    Great info thanks this article cleared up a gap for me.
    In this context a Custom Control is simply a dependency property class that inherits from Control instead of directly from DependencyObject. I assume the reasons are so it picks up features of the Control class for UI  / (Other?) functionality whereas a straight DepO is not suitable.
    The Custom Control becomes a backing store without any visual representation convoluting the intent / code. This is probably why it's called lookless. It doesn't know (or care) about how its own data is externally used, manipulated or represented. It just provides properties that expose this data to consumers. In the RW it would likely include data validation and a host of other methods focused on the minutiae of data processing. It's a perfect simple example of the fundamental WPF feature: Separation of UI / Code.

    So to me your question seems backwards. You're wanting to try and turn a User Control into a Custom Control. To me that would mean you're trying to decompose the UI elements of the User Control into property code. Maybe what you're after/need instead is an Attached Properties (RegisterAttached) class and not an actual Custom Control class?


Add Your 2 Cents