Xceed Toolkit Plus for WPF v5.0 Documentation
Xceed.Wpf.Toolkit Assembly / Xceed.Wpf.Toolkit.Panels Namespace / CameraPanel Class
Members Example


In This Topic
    CameraPanel Class
    In This Topic
    CameraPanel lays out its children in a 3D like space. You can give the children a 3D location and set the camera position for the panel.
    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 CameraPanel 
       Inherits AnimationPanel
    'Usage
     
    Dim instance As CameraPanel
    [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 CameraPanel : AnimationPanel 
    Example
    This example shows a simple scene with CameraPanel
    <Window x:Class="CameraPanel.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="CameraPanel">
      <Grid>
        <Grid.RowDefinitions>
          <RowDefinition />
          <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
    
        <xctk:CameraPanel x:Name="panel"
                          Background="{x:Null}"
                          CameraZ="{Binding Path=Value, ElementName=zSlider}"
                          CameraX="{Binding Path=Value, ElementName=xSlider}"
                          CameraY="{Binding Path=Value, ElementName=ySlider}"
                          ClipToBounds="True">
          <Rectangle Stroke="{x:Null}"
                    Fill="Green"
                    Width="166"
                    Height="1000"
                    VerticalAlignment="Bottom"
                    xctk:CameraPanel.Depth="300" />
          <Rectangle Stroke="{x:Null}"
                    Fill="Blue"
                    Width="166"
                    Height="1000"
                    xctk:CameraPanel.Depth="-600"
                    xctk:CameraPanel.Left="800"
                    VerticalAlignment="Bottom" />
          <Rectangle Stroke="{x:Null}"
                    Fill="Red"
                    Width="166"
                    Height="1000"
                    xctk:CameraPanel.Depth="-600"
                    xctk:CameraPanel.Left="-800" />
          <Rectangle Stroke="{x:Null}"
                    Fill="Yellow"
                    Width="166"
                    Height="1000"
                    xctk:CameraPanel.Depth="0"
                    xctk:CameraPanel.Left="300" />
          <Path Stretch="Fill"
                Stroke="{x:Null}"
                Fill="Orange"
                Width="5000"
                Height="1000"
                Data="M707.48904,558.12856 L2569,453.84605 3111.6667,3.2519989 5000,1000 0,1000 z"
                xctk:CameraPanel.Depth="-200"
                xctk:CameraPanel.Left="300"
                RenderTransformOrigin="0.5,0.5" />
        </xctk:CameraPanel>
       
        <Border HorizontalAlignment="Stretch"
                VerticalAlignment="Bottom"
                Width="Auto"
                Height="Auto"
                Background="#7FFFFFFF"
                BorderBrush="#7F000000"
                BorderThickness="3,3,3,3"
                CornerRadius="5,5,5,5"
                Margin="8,0,8,8"
                Padding="5,5,5,5">
          <StackPanel Width="Auto"
                      Height="Auto">
            <Grid>
              <TextBlock Text="X:  "
                        HorizontalAlignment="Left"
                        Width="16.25" />
              <Slider x:Name="xSlider"
                      Minimum="-1000"
                      Maximum="1000"
                      Width="Auto"
                      Value="130"
                      HorizontalAlignment="Stretch"
                      Margin="16,0,0,0" />
            </Grid>
            <Grid>
              <TextBlock Text="Y:  "
                        HorizontalAlignment="Left"
                        Width="15.807" />
              <Slider x:Name="ySlider"
                      Minimum="-1000"
                      Maximum="1000"
                      Value="140"
                      Margin="16,0,0,0" />
            </Grid>
            <Grid>
              <TextBlock Text="Z:  "
                        HorizontalAlignment="Left"
                        Width="16.017" />
              <Slider x:Name="zSlider"
                      Value="300"
                      Minimum="-1000"
                      Maximum="1000"
                      Margin="16,0,0,0" />
            </Grid>
          </StackPanel>
        </Border>
      </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.AnimationPanel
                               Xceed.Wpf.Toolkit.Panels.CameraPanel

    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