Xceed Toolkit Plus for WPF v4.6 Documentation
SwitchPanel Class
Members  Example 


Xceed.Wpf.Toolkit Assembly > Xceed.Wpf.Toolkit.Panels Namespace : SwitchPanel Class
Allows you to switch between panels with the same children on the fly with animation support.
Syntax
'Declaration
 
<LocalizabilityAttribute(LocalizationCategory.Ignore)>
<ContentPropertyAttribute("Children")>
<StyleTypedPropertyAttribute(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)>
<XmlLangPropertyAttribute("Language")>
<UsableDuringInitializationAttribute(True)>
<RuntimeNamePropertyAttribute("Name")>
<UidPropertyAttribute("Uid")>
<TypeDescriptionProviderAttribute(MS.Internal.ComponentModel.DependencyObjectProvider)>
<NameScopePropertyAttribute("NameScope", System.Windows.NameScope)>
Public Class SwitchPanel 
   Inherits PanelBase
'Usage
 
Dim instance As SwitchPanel
[Localizability(LocalizationCategory.Ignore)]
[ContentProperty("Children")]
[StyleTypedProperty(Property="FocusVisualStyle", StyleTargetType=System.Windows.Controls.Control)]
[XmlLangProperty("Language")]
[UsableDuringInitialization(true)]
[RuntimeNameProperty("Name")]
[UidProperty("Uid")]
[TypeDescriptionProvider(MS.Internal.ComponentModel.DependencyObjectProvider)]
[NameScopeProperty("NameScope", System.Windows.NameScope)]
public class SwitchPanel : PanelBase 
Example
A SwitchPanel example. You change the current layout by setting ActiveLayoutIndex property to a new value.
<Window x:Class="SwitchPanelSample.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:xctk="http://schemas.xceed.com/wpf/xaml/toolkit"
        Title="SwitchPanelSample">
  <Grid>
    <xctk:SwitchPanel>
      <xctk:SwitchPanel.Layouts>
        <xctk:AutoStretchStackPanel Orientation="Horizontal" />
        <xctk:AutoStretchStackPanel Orientation="Vertical" />
        <xctk:Canvas />
        <xctk:RadialCanvas />
        <xctk:RandomPanel MinimumHeight="80"
                                MaximumHeight="300"
                                MaximumWidth="400"
                                MinimumWidth="80" />
        <xctk:StackPanel Orientation="Horizontal"
                              Width="200" />
        <xctk:StackPanel Orientation="Vertical" />
        <xctk:WrapPanel Orientation="Horizontal" />
        <xctk:WrapPanel Orientation="Vertical" />
      </xctk:SwitchPanel.Layouts>
      <Rectangle Margin="2, 2, 2, 2"
                Width="300"
                Height="300"
                Fill="Red" />
      <Rectangle Margin="2, 2, 2, 2"
                Width="300"
                Height="300"
                Fill="Blue" />
      <Rectangle Margin="2, 2, 2, 2"
                Width="300"
                Height="300"
                Fill="Green" />
      <Rectangle Margin="2, 2, 2, 2"
                Width="300"
                Height="300"
                Fill="Orange" />
      <Rectangle Margin="2, 2, 2, 2"
                Width="300"
                Height="300"
                Fill="Purple" />
      <Rectangle Margin="2, 2, 2, 2"
                Width="300"
                Height="300"
                Fill="Yellow" />
    </xctk:SwitchPanel>
  </Grid>
</Window>
Inheritance Hierarchy

System.Object
   System.Windows.Threading.DispatcherObject
      System.Windows.DependencyObject
         System.Windows.Media.Visual
            System.Windows.UIElement
               System.Windows.FrameworkElement
                  System.Windows.Controls.Panel
                     Xceed.Wpf.Toolkit.Panels.PanelBase
                        Xceed.Wpf.Toolkit.Panels.SwitchPanel

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

Reference

SwitchPanel Members
Xceed.Wpf.Toolkit.Panels Namespace