UIElementCollection.Count 속성

정의

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

public:
 virtual property int Count { int get(); };
public virtual int Count { get; }
member this.Count : int
Public Overridable ReadOnly Property Count As Integer

속성 값

Int32

컬렉션의 실제 요소 수입니다.

구현

예제

다음 예제에서는 합니다 Count 의 자식 요소 수를 계산 하는 속성을 UIElementCollection입니다.

void GetCount(object sender, RoutedEventArgs e)
{
    TextBlock txt3 = new TextBlock();
    sp1.Children.Add(txt3);
    txt3.Text = "UIElement Count is equal to " + sp1.Children.Count.ToString();
}

적용 대상