VisualCollection クラス
重要
一部の情報は、リリース前に大きく変更される可能性があるプレリリースされた製品に関するものです。 Microsoft は、ここに記載されている情報について、明示または黙示を問わず、一切保証しません。
Visual オブジェクトの順序付きコレクションを表します。
public ref class VisualCollection sealed : System::Collections::ICollection
public sealed class VisualCollection : System.Collections.ICollection
type VisualCollection = class
interface ICollection
interface IEnumerable
Public NotInheritable Class VisualCollection
Implements ICollection
- 継承
-
VisualCollection
- 実装
次の例は、 を作成してメンバーを VisualCollection 追加する方法を示しています。
// Create a host visual derived from the FrameworkElement class.
// This class provides layout, event handling, and container support for
// the child visual objects.
public class MyVisualHost : FrameworkElement
{
// Create a collection of child visual objects.
private VisualCollection _children;
public MyVisualHost()
{
_children = new VisualCollection(this);
_children.Add(CreateDrawingVisualRectangle());
_children.Add(CreateDrawingVisualText());
_children.Add(CreateDrawingVisualEllipses());
// Add the event handler for MouseLeftButtonUp.
this.MouseLeftButtonUp += new System.Windows.Input.MouseButtonEventHandler(MyVisualHost_MouseLeftButtonUp);
}
' Create a host visual derived from the FrameworkElement class.
' This class provides layout, event handling, and container support for
' the child visual objects.
Public Class MyVisualHost
Inherits FrameworkElement
' Create a collection of child visual objects.
Private _children As VisualCollection
Public Sub New()
_children = New VisualCollection(Me)
_children.Add(CreateDrawingVisualRectangle())
_children.Add(CreateDrawingVisualText())
_children.Add(CreateDrawingVisualEllipses())
' Add the event handler for MouseLeftButtonUp.
AddHandler MouseLeftButtonUp, AddressOf MyVisualHost_MouseLeftButtonUp
End Sub
注意
完全なサンプルについては、「 DrawingVisuals サンプルを使用したヒット テスト」を参照してください。
には VisualCollection 暗黙的なコンテキスト アフィニティがあります。 プロシージャが 所有ContainerVisualする のコンテキストとは異なるコンテキストから にアクセスVisualCollectionしようとすると、例外がスローされます。
Visual |
VisualCollection クラスの新しいインスタンスを初期化します。 |
Capacity |
VisualCollection に格納できる要素の数を取得または設定します。 |
Count |
コレクション内の要素の数を取得します。 |
Is |
VisualCollection が読み取り専用かどうかを示す値を取得します。 |
Is |
VisualCollection へのアクセスが同期されている (スレッド セーフである) かどうかを示す値を取得します。 |
Item[Int32] |
Visual の 0 から始まるインデックス位置に格納されている VisualCollection を取得または設定します。 |
Sync |
VisualCollection へのアクセスを同期するために使用できるオブジェクトを取得します。 |
Add(Visual) |
Visual を VisualCollection の末尾に追加します。 |
Clear() |
VisualCollection からすべての要素を削除します。 |
Contains(Visual) | |
Copy |
指定した配列インデックスを開始位置として、コレクション内の項目を配列にコピーします。 |
Copy |
渡された Visual 配列に現在のコレクションをコピーします。 |
Equals(Object) |
指定されたオブジェクトが現在のオブジェクトと等しいかどうかを判断します。 (継承元 Object) |
Get |
VisualCollection を反復処理できる列挙子を取得します。 |
Get |
既定のハッシュ関数として機能します。 (継承元 Object) |
Get |
現在のインスタンスの Type を取得します。 (継承元 Object) |
Index |
Visual の 0 から始まるインデックスを返します。 |
Insert(Int32, Visual) |
VisualCollection 内の指定したインデックスの位置に要素を挿入します。 |
Memberwise |
現在の Object の簡易コピーを作成します。 (継承元 Object) |
Remove(Visual) |
指定した Visual オブジェクトを VisualCollection から削除します。 |
Remove |
VisualCollection 内の指定したインデックス位置にあるビジュアル オブジェクトを削除します。 |
Remove |
VisualCollection からビジュアル オブジェクトの範囲を削除します。 |
To |
現在のオブジェクトを表す文字列を返します。 (継承元 Object) |
IEnumerable. |
このメンバーは WPF インフラストラクチャをサポートしており、コードから直接使用することを意図したものではありません。 このメンバーの詳細については、「GetEnumerator()」をご覧ください。 |
Cast<TResult>(IEnumerable) |
IEnumerable の要素を、指定した型にキャストします。 |
Of |
指定された型に基づいて IEnumerable の要素をフィルター処理します。 |
As |
クエリの並列化を有効にします。 |
As |
IEnumerable を IQueryable に変換します。 |
製品 | バージョン |
---|---|
.NET Framework | 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
Windows Desktop | 3.0, 3.1, 5, 6, 7, 8, 9, 10 |
.NET に関するフィードバック
.NET はオープンソース プロジェクトです。 フィードバックを提供するにはリンクを選択します。