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 ASPX page.A Custom Control generally inherits from the
System.Windows.Controls.Control
class. You may derive from a different custom control depending on your requirement.Custom Controls are compiled into a DLL assembly and can be reused in multiple places very easily. You have total control over the code, thus gives you more flexibility to extend the behaviour. Once you build and add a reference of the custom control in your project, you can find it in the toolbox. Thus, you will be able to drag and drop the control in your Design view and start working with it very easily.
No comments:
Post a Comment