Panel Panel Panel Panel Class
Definition
public : class Panel : FrameworkElement, IPanelpublic class Panel : FrameworkElement, IPanelPublic Class Panel Inherits FrameworkElement Implements IPanel// This API is not available in Javascript.
- Inheritance
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited properties
Inherited events
Inherited methods
Remarks
Panel derived classes
Panel is the parent class for several immediately derived classes. Some of these are practical layout containers/panels. Others are intermediate base classes for specialized panels.
- Canvas
- Grid
- ItemsStackPanel
- ItemsWrapGrid
- RelativePanel
- StackPanel
- VariableSizedWrapGrid
- VirtualizingPanel
Constructors
Properties
Background Background Background Background
Gets or sets a Brush that fills the panel content area.
public : Brush Background { get; set; }public Brush Background { get; set; }Public ReadWrite Property Background As Brush// This API is not available in Javascript.
<panel Background="{StaticResource resourceName}"/>
The brush that fills the panel content area. The default is null, (a null brush) which is evaluated as Transparent for rendering.
Remarks
The Background value for a Panel -derived panel is visible underneath the inner area if the elements that are in the Children collection have transparency or null brushes for any of their defining area. It displays in the child margin area for any case where a child element has a nonzero Margin affecting its position. It is also visible between the layout positions of any child elements regardless of margin, although that can depend on how the panel implements its layout behavior. For example, in a Canvas, any pixel in the content area where there's not an absolutely positioned element covering it will show the panel Background brush.
If you're using a Panel class such as Grid or StackPanel as the root element of a control template, it's a common practice to use a {TemplateBinding} markup extension to bind the panel's background to the Control.Background property of the template parent (the control class that uses your template).
- See Also
BackgroundProperty BackgroundProperty BackgroundProperty BackgroundProperty
Identifies the Background dependency property.
public : static DependencyProperty BackgroundProperty { get; }public static DependencyProperty BackgroundProperty { get; }Public Static ReadOnly Property BackgroundProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the Background dependency property.
Children Children Children Children
Gets the collection of child elements of the panel.
public : UIElementCollection Children { get; }public UIElementCollection Children { get; }Public ReadOnly Property Children As UIElementCollection// This API is not available in Javascript.
<panel>
oneOrMoreUIElements
</panel>
The collection of child objects. The default is an empty collection.
ChildrenTransitions ChildrenTransitions ChildrenTransitions ChildrenTransitions
Gets or sets the collection of Transition style elements that apply to child content of a Panel subclass.
public : TransitionCollection ChildrenTransitions { get; set; }public TransitionCollection ChildrenTransitions { get; set; }Public ReadWrite Property ChildrenTransitions As TransitionCollection// This API is not available in Javascript.
<panel>
<panel.ChildTransitions>
<TransitionCollection>
oneOrMoreTransitions
</TransitionCollection>
</panel.ChildTransitions>
</panel>
The strongly typed collection of Transition style elements.
Remarks
Important
The XAML syntax for all properties that use a TransitionCollection value is unusual in that you must declare an explicit TransitionCollection object element as the value, and then provide object elements as child elements of TransitionCollection for each of the transition animations you want to use. For most other XAML collection properties you could omit the collection object element because it can be implicit, but properties that use TransitionCollection don't support the implicit collection usage. For more info on implicit collections and XAML, see XAML syntax guide.
Transition animations play a particular role in UI design of your app. The basic idea is that when there is a change or transition, the animation draws the attention of the user to the change.
- See Also
ChildrenTransitionsProperty ChildrenTransitionsProperty ChildrenTransitionsProperty ChildrenTransitionsProperty
Identifies the ChildrenTransitions dependency property.
public : static DependencyProperty ChildrenTransitionsProperty { get; }public static DependencyProperty ChildrenTransitionsProperty { get; }Public Static ReadOnly Property ChildrenTransitionsProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the ChildrenTransitions dependency property.
IsItemsHost IsItemsHost IsItemsHost IsItemsHost
Gets a value that indicates whether this Panel is a container for UI items that are generated by an ItemsControl.
public : PlatForm::Boolean IsItemsHost { get; }public bool IsItemsHost { get; }Public ReadOnly Property IsItemsHost As bool// This API is not available in Javascript.
- Value
- PlatForm::Boolean bool bool bool
true if this instance of Panel is an items host; otherwise, false. The default is false.
Remarks
IsItemsHost is a calculated property where the value results from the system checking the parents of the Panel for an ItemsControl implementation. If one exists, then the value is true.
In previous frameworks this property was settable. It's not settable in the Windows Runtime, and there should be no need to set it because the system has the calculation behavior. If you want a different relationship between a panel and a parent items control, just create it that way in your XAML control compositing.
IsItemsHostProperty IsItemsHostProperty IsItemsHostProperty IsItemsHostProperty
Identifies the IsItemsHost dependency property.
public : static DependencyProperty IsItemsHostProperty { get; }public static DependencyProperty IsItemsHostProperty { get; }Public Static ReadOnly Property IsItemsHostProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the IsItemsHost dependency property.