AdornerPlacementCollection 類別
在 AdornerPanel 中啟用裝飾項的精確定位。
繼承階層架構
System.Object
System.Collections.ObjectModel.Collection<IAdornerPlacement>
System.Collections.ObjectModel.ObservableCollection<IAdornerPlacement>
Microsoft.Windows.Design.Interaction.AdornerPlacementCollection
命名空間: Microsoft.Windows.Design.Interaction
組件: Microsoft.Windows.Design.Interaction (在 Microsoft.Windows.Design.Interaction.dll 中)
語法
'宣告
Public Class AdornerPlacementCollection _
Inherits ObservableCollection(Of IAdornerPlacement)
public class AdornerPlacementCollection : ObservableCollection<IAdornerPlacement>
public ref class AdornerPlacementCollection : public ObservableCollection<IAdornerPlacement^>
type AdornerPlacementCollection =
class
inherit ObservableCollection<IAdornerPlacement>
end
public class AdornerPlacementCollection extends ObservableCollection<IAdornerPlacement>
AdornerPlacementCollection 型別會公開下列成員。
建構函式
名稱 | 說明 | |
---|---|---|
![]() |
AdornerPlacementCollection | 初始化 AdornerPlacementCollection 類別的新執行個體。 |
回頁首
屬性
名稱 | 說明 | |
---|---|---|
![]() |
Count | 取得 Collection<T> 中實際包含的項目數目。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() |
Item | 取得或設定指定之索引處的項目。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() |
Items | 取得 Collection<T> 周圍的 IList<T> 包裝函式。 (繼承自 Collection<IAdornerPlacement>)。 |
回頁首
方法
回頁首
事件
名稱 | 說明 | |
---|---|---|
![]() |
CollectionChanged | 在將項目加入、移除、變更、移動,或整份清單重新整理時發生。 (繼承自 ObservableCollection<IAdornerPlacement>)。 |
![]() |
PropertyChanged | 發生於屬性值變更時。 (繼承自 ObservableCollection<IAdornerPlacement>)。 |
回頁首
明確介面實作
名稱 | 說明 | |
---|---|---|
![]() ![]() |
IList.Add | 將項目加入至 IList 中。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
IList.Contains | 判斷 IList 是否包含特定值。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
ICollection.CopyTo | 從特定的 Array 索引開始,複製 ICollection 項目至 Array。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
IEnumerable.GetEnumerator | 傳回會逐一查看集合的列舉程式。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
IList.IndexOf | 判斷 IList 中特定項目的索引。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
IList.Insert | 將項目插入 IList 中指定的索引處。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
IList.IsFixedSize | 取得值,指出 IList 是否有固定的大小。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
ICollection<T>.IsReadOnly | 取得值,這個值表示 ICollection<T> 是否為唯讀。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
IList.IsReadOnly | 取得值,指出 IList 是否為唯讀。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
ICollection.IsSynchronized | 取得值,這個值會指出對 ICollection 的存取是否已同步處理 (執行緒安全)。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
IList.Item | 取得或設定指定之索引處的項目。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
INotifyPropertyChanged.PropertyChanged | 發生於屬性值變更時。 (繼承自 ObservableCollection<IAdornerPlacement>)。 |
![]() ![]() |
IList.Remove | 從 IList 移除特定物件之第一個符合的元素。 (繼承自 Collection<IAdornerPlacement>)。 |
![]() ![]() |
ICollection.SyncRoot | 取得可用來對 ICollection 進行同步存取的物件。 (繼承自 Collection<IAdornerPlacement>)。 |
回頁首
備註
您可以使用 AdornerPlacementCollection 類別,指定 AdornerPanel 相對於其所裝飾之控制項的位置、大小和縮放屬性。
您可以呼叫 PositionRelativeToAdornerHeight 和 PositionRelativeToAdornerWidth 方法,相對於 AdornerPanel 之裝飾項控制項的高度和寬度來放置它。
您可以呼叫 SizeRelativeToAdornerDesiredWidth 和 SizeRelativeToContentHeight 方法,調整 AdornerPanel 相對於其裝飾項控制項的大小。
您可以呼叫對應的內容架構方法,調整 AdornerPanel 相對於所裝飾之內容的大小和位置。
對大小和位置方法的呼叫屬於累加性。 在下列程式碼範例中,會示範對 PositionRelativeToAdornerHeight 方法的兩個呼叫,這兩個呼叫都能將 AdornerPanel 置於所裝飾之控制項上方,Y 軸位移等於裝飾項高度加上五個像素的位置。
範例
在下列程式碼範例中,會說明如何使用 AdornerPlacementCollection,指定裝飾項在裝飾項面板中的位置。 如需詳細資訊,請參閱逐步解說:建立設計階段裝飾項。
執行緒安全
這個型別的任何 Public static (在 Visual Basic 中為 Shared) 成員都具備執行緒安全。並非所有的執行個體成員都是安全執行緒。
請參閱
參考
Microsoft.Windows.Design.Interaction 命名空間
PrimarySelectionAdornerProvider