IAdornerPlacement-Schnittstelle
Aktualisiert: November 2007
Gibt einen Platzierungsausdruck für AdornerPlacementCollection an.
Namespace: Microsoft.Windows.Design.Interaction
Assembly: Microsoft.Windows.Design.Interaction (in Microsoft.Windows.Design.Interaction.dll)
Syntax
'Declaration
Public Interface IAdornerPlacement
'Usage
Dim instance As IAdornerPlacement
public interface IAdornerPlacement
public interface class IAdornerPlacement
public interface IAdornerPlacement
Hinweise
Mit Platzierungsausdrücken wird eine Gruppe von Werten erstellt, die Flexibilität für die Positionierung und Größenanpassung von Adorners auf einem AdornerPanel ermöglichen.
Beispiele
Im folgenden Codebeispiel wird dargestellt, wie Platzierungen für einen Schienenadorner in einem Steuerelement eingerichtet werden. Weitere Informationen finden Sie unter Exemplarische Vorgehensweise: Implementieren einer Schiene in einem Steuerelement.
' 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);
Siehe auch
Referenz
Microsoft.Windows.Design.Interaction-Namespace
Weitere Ressourcen
Layoutbereich und Renderbereich
Exemplarische Vorgehensweise: Implementieren einer Schiene in einem Steuerelement