Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
605
XamGrid within Tile pane and animation
posted
Hello,
 
Here is a XAML:
 
<ResourceDictionary
    xmlns:dboard="clr-namespace:Infragistics.Controls.Lists;assembly=InfragisticsSL4.Controls.Lists.XamTileView.v10.3"
    mc:Ignorable="d">
  
    <!-- =============================================================================== -->
    <!-- TilePane Style                                                                  -->
    <!-- =============================================================================== -->
<Style TargetType="dboard:TilePane" x:Key="TilePaneWithButtons">
  <Setter Property="Template">
    <Setter.Value>
      <ControlTemplate TargetType="dboard:TilePane">
        <Grid x:Name="MainContentGrid" Background="Transparent">
          <Grid.Projection>
            <PlaneProjection/>
          </Grid.Projection>
          <VisualStateManager.VisualStateGroups>
            <VisualStateGroup x:Name="TileItemStates">
              <VisualState x:Name="EmptyTile"/>
              <VisualState x:Name="ItemTile"/>
            </VisualStateGroup>
            <VisualStateGroup x:Name="CommonStates">
              <VisualState x:Name="MouseOver"/>
              <VisualState x:Name="Common"/>
            </VisualStateGroup>
            <VisualStateGroup x:Name="TileStates">
              <VisualState x:Name="Maximized"/>
              <VisualState x:Name="Normal"/>
              <VisualState x:Name="Minimized"/>
            </VisualStateGroup>
            <VisualStateGroup x:Name="TileDragStates">
              <VisualState x:Name="Dragging"/>
              <VisualState x:Name="DropTarget"/>
              <VisualState x:Name="NoDrag"/>
            </VisualStateGroup>
            <!--Animation rotation content-->
            <VisualStateGroup x:Name="AnimationStates">
              <VisualStateGroup.Transitions>
                <VisualTransition From="FirstFlipAnimation" GeneratedDuration="0">
                  <Storyboard>
                    <DoubleAnimation Duration="0:0:0.5" To="90"
 Storyboard.TargetProperty="(UIElement.Projection).PlaneProjection.RotationY)"
 Storyboard.TargetName="MainContentGrid"/>
                  </Storyboard>
                </VisualTransition>
                <VisualTransition From="SecondFlipAnimation"
                  GeneratedDuration="0:0:0.5">
                  <Storyboard>
                    <DoubleAnimation Duration="0:0:0.5"
                     From="-90"
Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)"
Storyboard.TargetName="MainContentGrid"/>
                  </Storyboard>
                </VisualTransition>
                <VisualTransition From="SecondFlipAnimation"
GeneratedDuration="0" To="FirstFlipAnimation"/>
              </VisualStateGroup.Transitions>
              <VisualState x:Name="FirstFlipAnimation"/>
              <VisualState x:Name="SecondFlipAnimation">
                <Storyboard>
                  <DoubleAnimationUsingKeyFrames
Storyboard.TargetProperty="(UIElement.Projection).(PlaneProjection.RotationY)"
Storyboard.TargetName="MainContentGrid">
                    <EasingDoubleKeyFrame KeyTime="0" Value="270"/>
                    <EasingDoubleKeyFrame KeyTime="0:0:1" Value="360"/>
                  </DoubleAnimationUsingKeyFrames>
                </Storyboard>
              </VisualState>
            </VisualStateGroup>
          </VisualStateManager.VisualStateGroups>
          <Border>
            <Border.Effect>
              <DropShadowEffect BlurRadius="8" Opacity="0.25" ShadowDepth="3" />
            </Border.Effect>
            <Popup x:Name="PopupDropIndicator" IsOpen="False" />
          </Border>
 
          <Border x:Name="RootBorder" CornerRadius="4">
            <Border.Projection>
              <PlaneProjection/>
            </Border.Projection>
            <Grid x:Name="PresenterGrid">
              <Grid.RowDefinitions>
                <RowDefinition Height="Auto" MinHeight="18" />
                <RowDefinition Height="*" />
              </Grid.RowDefinitions>
              <Rectangle x:Name="TilePaneBackground" Margin="0" RadiusY="4"
               RadiusX="4" Grid.RowSpan="2">
                <Rectangle.Fill>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="White" Offset="0"/>
                    <GradientStop Color="White" Offset="1"/>
                    <GradientStop Color="#FEEBEBEB" Offset="0.065"/>
                    <GradientStop Color="#FEFFFFFF" Offset="0.81"/>
                  </LinearGradientBrush>
                </Rectangle.Fill>
 
                <Rectangle.Stroke>
                  <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                    <GradientStop Color="#FF999999" Offset="0"/>
                    <GradientStop Color="#FF999999" Offset="1"/>
                    <GradientStop Color="#FF75FFE9" Offset="0.442"/>
                  </LinearGradientBrush>
                </Rectangle.Stroke>
 
              </Rectangle>
              <Rectangle Margin="0" Grid.RowSpan="1" RadiusX="4" RadiusY="4" />
              <Border Cursor="Hand" CornerRadius="4,4,0,0" Margin="0"
               BorderThickness="0">
                <Grid>
                  <Border BorderThickness="1,1,1,0" Margin="0"
                    CornerRadius="3,3,0,0" />
 
                  <ContentPresenter x:Name="headerContentPresenter"
                    Cursor="{TemplateBinding Cursor}" 
                    HorizontalAlignment="Stretch"
                    Content="{TemplateBinding Header}"
                    ContentTemplate="{TemplateBinding HeaderTemplate}"
                    DataContext="{TemplateBinding DataContext}"
                    VerticalAlignment="Center" />
 
                </Grid>
              </Border>
              <Rectangle x:Name="contentContentPresenterBG" Grid.Row="1" />
              <Border BorderThickness="0" Margin="0" Grid.Row="1"
                      CornerRadius="0,0,4,4">
                <ContentPresenter x:Name="contentContentPresenter"
ContentTemplate="{TemplateBinding ContentTemplate}" Margin="3,0,3,3" />
              </Border>
            </Grid>
          </Border>
        </Grid>
      </ControlTemplate>
    </Setter.Value>
  </Setter>
</Style>
</ResourceDictionary>
 
I have a custom UserControl within XamGrid which contains  some visual states. This control placed in TilePane’s content.
After the animation is run, TilePane rotates and visual state of custom UserControl changes to another, so XamGrid becomes invisible.
Then I run animation again it returns to initial visual state. So XamGrid becomes visible.
 
And after all these manipulations we have problem  with columns’ resize functionality. Only first column is resizable, but all other columns are frizzed (we can’t resize them any more).
Then I try to access property “ShowResizingArrow” of “CellControl”  it throws an “System.NullReferenceException”
As I understood, after XamGrid becomes visible in this situation, the HeaderCells (which is CellControl) changes property “Cell”.
 
Could you please help me to solve this issue?
May be something wrong with a TilePane’s style?
BR,
Alexey Lukyanov
Parents Reply Children