IAdornerPlacement (Interfaz)

Actualización: noviembre 2007

Especifica una condición de colocación para AdornerPlacementCollection.

Espacio de nombres:  Microsoft.Windows.Design.Interaction
Ensamblado:  Microsoft.Windows.Design.Interaction (en Microsoft.Windows.Design.Interaction.dll)

Sintaxis

Public Interface IAdornerPlacement

Dim instance As IAdornerPlacement
public interface IAdornerPlacement
public interface class IAdornerPlacement
public interface IAdornerPlacement

Comentarios

Las condiciones de colocación se utilizan para generar un conjunto de valores que proporcionan flexibilidad en lo que respecta a la posición y el tamaño de los adornos en AdornerPanel.

Ejemplos

En el siguiente ejemplo de código se muestra cómo configurar la colocación de un adorno de raíl dentro de un control. Para obtener más información, consulte Tutorial: Implementar un raíl en un control.

' Place the slider in the adorner panel.
Dim placement As New AdornerPlacementCollection()
AdornerPanel.SetHorizontalStretch(skewSlider, AdornerStretch.Stretch)
AdornerPanel.SetVerticalStretch(skewSlider, AdornerStretch.None)

' Use layout space for the adorner panel.
' If render space were used, the slider would skew along with the button.
panel.CoordinateSpace = AdornerCoordinateSpaces.Layout

' The adorner's width is relative to the content.
' The slider extends half the width of the control it adorns.
placement.SizeRelativeToContentWidth(0.5, 0)

' Center the adorner within the control.
placement.PositionRelativeToAdornerWidth(0.5, 0)

' The adorner's height is the same as the slider's.
placement.SizeRelativeToAdornerDesiredHeight(1.0, 0)

' Position the adorner within the control it adorns.
placement.PositionRelativeToAdornerHeight(1.0, 0)

AdornerPanel.SetPlacements(skewSlider, placement)
// Place the slider in the adorner panel.
AdornerPlacementCollection placement = new AdornerPlacementCollection();
AdornerPanel.SetHorizontalStretch(skewSlider, AdornerStretch.Stretch);
AdornerPanel.SetVerticalStretch(skewSlider, AdornerStretch.None);

// Use layout space for the adorner panel.
// If render space were used, the slider would skew along with the button.
panel.CoordinateSpace = AdornerCoordinateSpaces.Layout;

// The adorner's width is relative to the content.
// The slider extends half the width of the control it adorns.
placement.SizeRelativeToContentWidth(0.5, 0);

// Center the adorner within the control.
placement.PositionRelativeToAdornerWidth(0.5, 0);

// The adorner's height is the same as the slider's.
placement.SizeRelativeToAdornerDesiredHeight(1.0, 0);

// Position the adorner within the control it adorns.
placement.PositionRelativeToAdornerHeight(1.0, 0);

AdornerPanel.SetPlacements(skewSlider, placement);

Vea también

Referencia

IAdornerPlacement (Miembros)

Microsoft.Windows.Design.Interaction (Espacio de nombres)

AdornerPlacementCollection

AdornerPanel

Otros recursos

Espacio de diseño y espacio de representación

Tutorial: Implementar un raíl en un control

Introducción a la extensibilidad de WPF Designer