What are the different models for Control authoring ?

1. Deriving from UserControl class. Consider this when, Your control consists of existing components. You don’t need to support complex customization. 2. Deriving from Control, You would like the appearance of the control through ControlTemplate. You would like the control to support different themes. 3. Deriving from FrameworkElement, You want to have fine-grained control over the appearance of your control beyond what is generally provided. You want to define the appearance of your control by defining your own render logic.

Where can adorners be used ?

Adding functional handles to a UIElement that enables a user to manipulate the element in some way (resize, rotate, reposition etc.). Provide visual feedback to indicate various states or in response to various events. Overlay visual decorations on a UIElement. Visually mask or override part or all of UIElement.

What is an adorner ?

Adorners are a special type of FrameworkElement used to provide visual cues. It can be used to add functional handle to elements or provide state information about the control. There is a class that plays an important role in rendering called ‘AdornerDecorator’. This class determines the placement of the ‘AdornerLayer’ in the visual tree.

How can I animate a Popup ?

In order to rotate the Popup, this example assigns a RotateTransform to the ‘RenderTransform’ property on the Canvas, which is the child element of the Popup. For the transform to work correctly, the example must set the ‘AllowsTransparency property’ to true. In addition, the Margin on the Canvas content must specify enough space for the Popup to rotate. [XAML] <Popup IsOpen='{Binding ElementName=myCheckBox,Path=IsChecked}' PlacementTarget='{Binding ElementName=myCheckBox}' AllowsTransparency='True' PopupAnimation='Slide' HorizontalOffset='50' VerticalOffset='50' > <!--The Margin set on the Canvas provides the additional area around the Popup so that the Popup is visible when it rotates.--> <Canvas Width='100' Height='100' Background='DarkBlue' Margin='150'> <Canvas.RenderTransform> <RotateTransform x:Name='theTransform' /> </Canvas.RenderTransform> <TextBlock TextWrapping='Wrap' Foreground='White'> Rotating Popup </TextBlock> </Canvas> </Popup>