This is a mirror of official site: http://jasper-net.blogspot.com/

So what's the difference between a Custom Control and User Control?

| Sunday, June 19, 2011
That's a good question that came up after the series in my blog. Someone asked why should one use a Custom Control instead of a User Control? Hence, let's extend the series and discuss about that. I apologize for the delay of this post. I should have explained this at the start of the series, but actually my goal was to explain to you how to create and use a Custom Control in Silverlight.

It is better to do it later than never. Also, you are now familiar with Custom Control creation. Hence, start describing it. You will come to know more about this here. As always, don't forget to share your feedback at the end of this page.

Background

If you came here through a search engine result, I will recommend you read my series of articles on Custom Controls after reading this post. That will help you to understand how to create a Custom Control in Silverlight. You can find the chapters here:

How to create a Custom Control in Silverlight
How to design a Custom Control by editing the Part Template
How to implement Template Binding in a Silverlight Custom Control
How to access Control Template parts from Code Behind
Let's start by describing the differences between a Custom Control and a User Control.

What is a Custom Control?

A custom control is a loosely coupled control defined in a class, which derives from Control. The UI of the custom control is generally defined in a Resource Dictionary inside the resource file. We can create themes for a custom control and reuse it in various projects very easily.

Button, CheckBox, TextBox etc., even a UserControl is nothing but a Custom Control. You can easily load them inside a XAML page.

Read more: Codeproject

Posted via email from Jasper-net

0 comments: