Xceed Toolkit for .NET Maui v2.0 Documentation
Xceed.Maui.Toolkit Assembly / Xceed.Maui.Toolkit Namespace / PopupContainer Class
Members Example


In This Topic
    PopupContainer Class
    In This Topic
    The PopupContainer can be added in a xaml container to define the location of the Popup in the visual tree & set its properties through bindings.
    Syntax
    'Usage
     
    
    Dim instance As PopupContainer
    Remarks
    The PopupContainer internaly creates a Popup.
    Example

    In the following example, a ToggleButton & a PopupContainer coexist in the visual tree. The PopupContainer is anchored to the ToggleButton, using the ToggleButton's bottom left side as the anchor point. The Popup created by the PopupContainer has an orange Background & contains a Label. This Popup opens when the ToggleButton becomes in its Checked state.

    Visually, the following code would display this Control:

    <xctk:ToggleButton x:Name="_toggleButton"
                       Content="TEST"
                       WidthRequest="300"/>
    <xctk:PopupContainer Anchor="{Binding ., Source={x:Reference _toggleButton}}"
                         HorizontalOptions="Start"
                         VerticalOptions="End"
                         IsModal="False"
                         IsOpen="{Binding IsChecked, Source={x:Reference _toggleButton}}">
      <xctk:Border Background="Orange"
                   BorderBrush="Black"
                   BorderThickness="4"
                   CornerRadius="8">
        <Label Text="My PopupContainer"
               Margin="20"/>
      </xctk:Border>
    </xctk:PopupContainer>
    Inheritance Hierarchy

    System.Object
       Microsoft.Maui.Controls.BindableObject
          Microsoft.Maui.Controls.Element
             Microsoft.Maui.Controls.NavigableElement
                Microsoft.Maui.Controls.VisualElement
                   Microsoft.Maui.Controls.View
                      Microsoft.Maui.Controls.Compatibility.Layout
                         Microsoft.Maui.Controls.TemplatedView
                            Xceed.Maui.Toolkit.PopupContainer

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also