Introduction
Every UI framework must provide a set of standard controls, such as text boxes, buttons, and list boxes. WPF is no different.
The difference between elements and controls is not that important in practice, but it is useful to understand the distinction.
Elements derive from FrameworkElement
(directly or indirectly), but not from Control
. They have a certain look and provide some functionality that is customizable, mostly by changing properties. For example, an Ellipse
is an element. There's no way to change the fundamental appearance of an Ellipse
(and it would be illogical to be able to turn an Ellipse
into (for example) a triangle). We can still customize an Ellipse
in a few ways using properties such as Stroke
, StrokeThickness
, Fill
, and Stretch
.
Controls, on the other hand, derive (directly or indirectly) from the Control
class. Control
adds a bunch of properties, of which the most significant is the Template
property. This allows complete changing of the control's appearance...