Interface IAdornerPlacement
Especifica um termo de posicionamento para um AdornerPlacementCollection.
Namespace: Microsoft.Windows.Design.Interaction
Assembly: Microsoft.Windows.Design.Interaction (em Microsoft.Windows.Design.Interaction.dll)
Sintaxe
Public Interface IAdornerPlacement
Dim instance As IAdornerPlacement
public interface IAdornerPlacement
public interface class IAdornerPlacement
public interface IAdornerPlacement
Comentários
Termos de colocação são usados para construir um conjunto de valores que fornecem flexibilidade para o posicionamento e dimensionamento do adorners em um AdornerPanel.
Exemplos
O exemplo de código a seguir mostra como conjunto posições de adorno um trilho dentro de um controle.Para obter mais informações, consulte Demonstra Passo a passo: Implementando um rail dentro de um Controlarar.
' 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);
Consulte também
Referência
Namespace Microsoft.Windows.Design.Interaction
Outros recursos
Espaço de layout e espaço de processamento
Demonstra Passo a passo: Implementando um rail dentro de um Controlarar