この
Panel の子要素の
UIElementCollection を取得します。
名前空間: System.Windows.Controls
アセンブリ: PresentationFramework (presentationframework.dll 内)
XML 名前空間 : http://schemas.microsoft.com/winfx/2006/xaml/presentation
Public ReadOnly Property Children As UIElementCollection
Dim instance As Panel
Dim value As UIElementCollection
value = instance.Children
public UIElementCollection Children { get; }
public:
property UIElementCollection^ Children {
UIElementCollection^ get ();
}
/** @property */
public UIElementCollection get_Children ()
public function get Children () : UIElementCollection
<object>
<UIElementCollection .../>
</object>
プロパティ値
UIElementCollection。既定値は空の UIElementCollection です。
コンテンツ モデル : Panel は、子コンテンツに強力なコンテンツ モデルを適用します。Panel 要素の Children コレクションを構成できるのは、UIElement オブジェクトだけです。UIElement の子を暗黙的に Panel に追加すると、Panel 要素の UIElementCollection に追加されます。
派生 Panel クラスではこのコレクションを使用せず、InternalChildren コレクションを使用してください。
このプロパティは、Panel がデータ バインドされている場合は null 参照 (Visual Basic では Nothing) を返します。
Children プロパティを使用して UIElement の子を Panel 要素に追加する方法を次のコード例に示します。
StackPanel myStackPanel = new StackPanel();
Button myButton = new Button();
myButton.Content = "Press me";
myStackPanel.Children.Add(myButton);
Microsoft .NET Framework 3.0 は Windows Vista,Microsoft Windows XP SP2,および Windows Server 2003 SP1 でサポートされています。
.NET Framework
サポート対象 : 3.0