#179 – Panel Controls Contain UIElement Children

Elements that act as containers for multiple controls are known as panels, inheriting from Panel.  A panel can contain one or more children, each deriving from UIElement.

Some examples of classes deriving from Panel include:

  • Canvas
  • DockPanel
  • Grid
  • TabPanel
  • UniformGrid
  • StackPanel
  • DataGridCellsPanel
  • VirtualizingStackPanel
  • WrapPanel

Any object that inherits from UIElement, directly or indirectly, can be hosted in a panel.

Examples of objects that can be hosted in a panel include (indentation indicates inheritance):

  • A ContentPresenter
  • Subclasses of Control
    • Calendar
    • Subclasses of ContentControl
      • Label
      • ListBoxItem
      • Subclasses of ButtonBase
        • Button
        • RepeatButton
        • ToggleButton
      • ScrollViewer
      • UserControl
    • DatePicker
    • Subclasses of ItemsControl
      • Subclasses of HeaderedItemsControl
        • MenuItem
        • Toolbar
      • Subclasses of MenuBase
        • ContextMenu
        • Menu
      • Subclasses of Selector
        • ComboBox
        • ListBox
        • Subclasses of MultiSelector
          • DataGrid
        • TabControl
      • StatusBar
      • TreeView
    • PasswordBox
    • Subclasses of RangeBase
      • ScrollBar
      • ProgressBar
      • Slider
    • Subclasses of TextBoxBase
      • RichTextBox
      • TextBox
    • Separator
  • Image
  • InkCanvas
  • An ItemsPresenter
  • MediaElement
  • Page
  • Another Panel
  • TextBlock
  • Viewport3D
  • Subclasses of Shape
    • Ellipse
    • Line
    • Path
    • Polygon
    • Polyline
    • Rectangle
Advertisement