VisualCollection 클래스

정의

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 상황에 맞는 선호도 암시적인 합니다. 프로시저에 액세스 하려고 하는 경우는 VisualCollection 소유 하 고 있는 컨텍스트 이외의 다른 컨텍스트에서 ContainerVisual, 예외가 throw 됩니다.

생성자

VisualCollection(Visual)

VisualCollection 클래스의 새 인스턴스를 초기화합니다.

속성

Capacity

VisualCollection에 포함될 수 있는 요소의 수를 가져오거나 설정합니다.

Count

컬렉션의 요소 수를 가져옵니다.

IsReadOnly

VisualCollection이 읽기 전용인지 여부를 나타내는 값을 가져옵니다.

IsSynchronized

VisualCollection에 대한 액세스가 동기화되어 스레드로부터 안전하게 보호되는지를 나타내는 값을 가져옵니다.

Item[Int32]

Visual의 0부터 시작하는 인덱스 위치에 저장된 VisualCollection을 가져오거나 설정합니다.

SyncRoot

VisualCollection에 대한 액세스를 동기화하는 데 사용할 수 있는 개체를 가져옵니다.

메서드

Add(Visual)

Visual의 끝에 VisualCollection을 추가합니다.

Clear()

VisualCollection에서 요소를 모두 제거합니다.

Contains(Visual)

지정한 Boolean이 컬렉션에 포함되어 있는지 여부를 나타내는 Visual 값을 반환합니다.

CopyTo(Array, Int32)

특정 배열 인덱스에서 시작하여 컬렉션의 항목을 배열에 복사합니다.

CopyTo(Visual[], Int32)

전달된 Visual 배열에 현재 컬렉션을 복사합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
GetEnumerator()

VisualCollection을 반복할 수 있는 열거자를 검색합니다.

GetHashCode()

기본 해시 함수로 작동합니다.

(다음에서 상속됨 Object)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
IndexOf(Visual)

Visual의 인덱스(0부터 시작)를 반환합니다.

Insert(Int32, Visual)

VisualCollection의 지정된 인덱스에 요소를 삽입합니다.

MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
Remove(Visual)

Visual에서 지정한 VisualCollection 개체를 제거합니다.

RemoveAt(Int32)

VisualCollection의 지정한 인덱스에서 시각적 개체를 제거합니다.

RemoveRange(Int32, Int32)

VisualCollection에서 시각적 개체의 범위를 제거합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

IEnumerable.GetEnumerator()

이 멤버는 WPF 인프라를 지원하며 코드에서 직접 사용할 수 없습니다. 이 멤버에 대한 설명은 GetEnumerator()를 참조하세요.

확장 메서드

Cast<TResult>(IEnumerable)

IEnumerable의 요소를 지정된 형식으로 캐스팅합니다.

OfType<TResult>(IEnumerable)

지정된 형식에 따라 IEnumerable의 요소를 필터링합니다.

AsParallel(IEnumerable)

쿼리를 병렬화할 수 있도록 합니다.

AsQueryable(IEnumerable)

IEnumerableIQueryable로 변환합니다.

적용 대상