AdornerPanel.SetAdornerHorizontalAlignment Method
Sets the AdornerHorizontalAlignment attached property for the provided element.
Namespace: Microsoft.Windows.Design.Interaction
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
Syntax
'Declaration
Public Shared Sub SetAdornerHorizontalAlignment ( _
obj As DependencyObject, _
value As AdornerHorizontalAlignment _
)
public static void SetAdornerHorizontalAlignment(
DependencyObject obj,
AdornerHorizontalAlignment value
)
public:
static void SetAdornerHorizontalAlignment(
DependencyObject^ obj,
AdornerHorizontalAlignment value
)
static member SetAdornerHorizontalAlignment :
obj:DependencyObject *
value:AdornerHorizontalAlignment -> unit
public static function SetAdornerHorizontalAlignment(
obj : DependencyObject,
value : AdornerHorizontalAlignment
)
Parameters
- obj
Type: System.Windows.DependencyObject
The element to which the attached property is written.
- value
Type: Microsoft.Windows.Design.Interaction.AdornerHorizontalAlignment
AdornerHorizontalAlignment to be set to the AdornerPanel.
Examples
The following code example shows how to use the SetAdornerHorizontalAlignment method to specify the horizontal alignment for an adorner. For more information, see Walkthrough: Creating a Design-time Adorner.
' The slider extends the full width of the control it adorns.
AdornerPanel.SetAdornerHorizontalAlignment( _
opacitySlider, _
AdornerHorizontalAlignment.Stretch)
' Position the adorner above the control it adorns.
AdornerPanel.SetAdornerVerticalAlignment( _
opacitySlider, _
AdornerVerticalAlignment.OutsideTop)
' Position the adorner 5 pixels above the control.
AdornerPanel.SetAdornerMargin( _
opacitySlider, _
New Thickness(0, 0, 0, 5))
// The slider extends the full width of the control it adorns.
AdornerPanel.SetAdornerHorizontalAlignment(
opacitySlider,
AdornerHorizontalAlignment.Stretch);
// Position the adorner above the control it adorns.
AdornerPanel.SetAdornerVerticalAlignment(
opacitySlider,
AdornerVerticalAlignment.OutsideTop);
// Position the adorner 5 pixels above the control.
AdornerPanel.SetAdornerMargin(
opacitySlider,
new Thickness(0, 0, 0, 5));
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.
See Also
Reference
Microsoft.Windows.Design.Interaction Namespace