RotateTransition is not working..

Aug 28, 2009 at 9:21 PM

Hello Sir,
            I am trying to get this working but some how I couldnt get it working. "maincontent" is the stack panel  am trying to rotate. Can you please help?

Thank you

 

    <Window.Resources>
        <VisualBrush x:Key="TransitionReflection" Visual="{Binding ElementName=TransitionBox}" Stretch="Fill">
            <VisualBrush.RelativeTransform>
                <TransformGroup>
                    <ScaleTransform ScaleX="1" ScaleY="-1" />
                    <TranslateTransform  Y="1" />
                </TransformGroup>
            </VisualBrush.RelativeTransform>
        </VisualBrush>
        <LinearGradientBrush x:Key="ReflectionFade" EndPoint="0.694,0.808" StartPoint="0.726,-0.264">
            <GradientStop Color="#FF000000" Offset="0"/>
            <GradientStop Color="#00FFFFFF" Offset="1"/>
        </LinearGradientBrush>

    </Window.Resources>
    <Grid>
       <DockPanel >
            <Border x:Name="searchbar" Background="LightBlue" DockPanel.Dock="Top" CornerRadius="6"
                Margin="4" Padding="4" Width="Auto" >
                <DockPanel LastChildFill="True">
                    <TextBlock x:Name="txtTitle" Text="Contact Manager" FontWeight="Bold"
                       Foreground="White" VerticalAlignment="Center" FontSize="22"
                       FontFamily="Trebuchet" />
                    <TextBox x:Name="searchText" DockPanel.Dock="Right" Width="150"
                         Background="White"  TextChanged="searchText_TextChanged" />
                    <Label DockPanel.Dock="Right" Content="Search:" FontWeight="Bold"
                       Foreground="White" HorizontalAlignment="Right" />
                </DockPanel>
            </Border>
            <StatusBar x:Name="statbar" DockPanel.Dock="Bottom">
                    <StatusBarItem DockPanel.Dock="Right">
                        <Slider x:Name="zoomSlider" Width="125" Value="1" Minimum=".5" Maximum="2" />
                    </StatusBarItem>
                    <StatusBarItem DockPanel.Dock="Right">
                        <TextBlock>Zoom:</TextBlock>
                    </StatusBarItem>
                    <StatusBarItem>
                        <TextBlock Text="{Binding StatusText}" Background="Aqua" />
                    </StatusBarItem>
                <StatusBarItem>
                    <StackPanel x:Name="pnl" Orientation="Horizontal" >
                        <Label x:Name="lbl_sysID"  Width="25" Background="SkyBlue" VerticalAlignment="Center" HorizontalAlignment="Right" Content="ID:"/>
                        <TextBox x:Name="txt_sysID"  Width="40" Background="SkyBlue" Margin="4" Text="{Binding Path= ID, Mode=OneWay}" IsReadOnly="True"  />
                    </StackPanel>
                </StatusBarItem>
            </StatusBar>
                <Expander x:Name="exp_LB" DockPanel.Dock="Left" ExpandDirection="Right" IsExpanded="False"
                  BorderThickness="0 1 1 1" BorderBrush="Gray" Margin="0 2 0 0" Padding="2" >
                    <Expander.Header>
                        <TextBlock Text="Contacts" FontSize="14" FontWeight="Bold">
                    <TextBlock.LayoutTransform>
                        <RotateTransform Angle="90" />
                    </TextBlock.LayoutTransform>
                        </TextBlock>
                    </Expander.Header>
                    <StackPanel x:Name="pnlListBox" Width="150"  >
                    <Grid x:Name="dynamicHostLB">
                    </Grid>
                </StackPanel>
                </Expander>
            <StackPanel x:Name="pnlButtons" DockPanel.Dock="Bottom" Height="40" HorizontalAlignment="Left" >
                <local:UC_FishButton x:Name="toolbarUC"/>
            </StackPanel>
            <StackPanel x:Name="maincontent" DockPanel.Dock="Right" Margin="50">
                <transc:TransitionElement x:Name="TransitionBox" >
                    <transc:TransitionElement.TransitionSelector>
                        <trans:RandomTransitionSelector >
                            <transt:RotateTransition Angle="45" />
                        </trans:RandomTransitionSelector>
                    </transc:TransitionElement.TransitionSelector>
                </transc:TransitionElement>
                <Rectangle x:Name="ReflectionBox" Height="50"
                           OpacityMask="{DynamicResource ReflectionFade}"
                           Fill="{DynamicResource TransitionReflection}"  >
                </Rectangle>
            </StackPanel>
       </DockPanel>
    </Grid>
</Window>