IAdornerPlacement - интерфейс
Обновлен: Ноябрь 2007
Задает условие размещения для AdornerPlacementCollection.
Пространство имен: Microsoft.Windows.Design.Interaction
Сборка: Microsoft.Windows.Design.Interaction (в Microsoft.Windows.Design.Interaction.dll)
Синтаксис
'Декларация
Public Interface IAdornerPlacement
'Применение
Dim instance As IAdornerPlacement
public interface IAdornerPlacement
public interface class IAdornerPlacement
public interface IAdornerPlacement
Заметки
Условия размещения используются для создания набора значений, которые обеспечивают гибкость в позиционировании и установке размеров декоративных элементов в панели AdornerPanel.
Примеры
Следующий пример кода показывает, как задать значения размещения для декоративного элемента границы внутри элемента управления. Дополнительные сведения см. в разделе Пошаговое руководство. Реализация границы в элементе управления.
' 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);
См. также
Ссылки
Microsoft.Windows.Design.Interaction - пространство имен
Другие ресурсы
Пространство макета и пространство визуализации
Пошаговое руководство. Реализация границы в элементе управления