DevZest WPF Docking
AdornerManager Class |
Provides attached properties to get or set a UIElement or DataTemplate as the adorner of
FrameworkElement.
Inheritance Hierarchy
Namespace: DevZest.Windows
Assembly: DevZest.WpfDocking (in DevZest.WpfDocking.dll) Version: 2.5.0.0 (2.5.5912.0)
Syntax
The AdornerManager type exposes the following members.
Methods
Name | Description | |
---|---|---|
GetAdorner | Gets the value of Adorner attached property
from a given FrameworkElement. | |
GetAdornerTemplate | Gets the value of AdornerTemplate attached property
from a given FrameworkElement. | |
SetAdorner | Sets the value of Adorner attached property
to a given FrameworkElement. | |
SetAdornerTemplate | Sets the value of AdornerTemplate attached property
to a given FrameworkElement. |
Fields
Name | Description | |
---|---|---|
AdornerProperty | Identifies the Adorner attached property. | |
AdornerTemplateProperty | Identifies the AdornerTemplate attached property. |
Attached Properties
Name | Description | |
---|---|---|
Adorner | Gets or sets the adorner UIElement. | |
AdornerTemplate | Gets or sets the adorner DataTemplate. |
Remarks
AdornerManager provides two attached properties: Adorner to get or set UIElement as adorner of FrameworkElement; and AdornerTemplate to get or set DataTemplate as adorner of FrameworkElement. You can use these attached properties to declare adorner of FrameworkElement in XAML.
AdornerTemplate provides similar functionality as Adorner, however it can be used in style setters because direct UI child is not allowed. Both way the provided adorner inherits DataContext as adorned element.
Setting adorner for specified FrameworkElement will clear the adorner previously set, no matter using Adorner or AdornerTemplate attached properties.
Examples
The following example demostrates the usage of Adorner and AdornerTemplate attached property:
XAML
<Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:dz="http://schemas.devzest.com/presentation"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Button Content="Button" Grid.Row="0"> <dz:AdornerManager.AdornerTemplate> <DataTemplate> <Grid Opacity="0.5"> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Rectangle Fill="Blue"/> <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontStyle="Italic" Text="{Binding Content}" /> </Grid> </DataTemplate> </dz:AdornerManager.AdornerTemplate> </Button> <Button Content="Button" Grid.Row="1"> <dz:AdornerManager.Adorner> <Grid Opacity="0.5"> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Rectangle Fill="Blue"/> <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" FontStyle="Italic" Text="{Binding Content}" /> </Grid> </dz:AdornerManager.Adorner> </Button> </Grid> </Window>
See Also