Tuesday, April 11, 2006 - Posts

XAML for PSP Background in XAML

I didn't want to include the XAML with the last post just because of the size. If you want it, here it is. The scene1.xaml, application.xaml and Tags.xml file. Just open a new project in the Feb CTP of Expression Interactive Designer and swap the XAML in each file for mine.  Have fun.

Tags: Expression | XAML

-----------------------Scene1.xaml-----------------------
<Grid  xmlns="
http://schemas.microsoft.com/winfx/2006/xaml/presentation"
 xmlns:x="
http://schemas.microsoft.com/winfx/2006/xaml"
 xmlns:c="
http://schemas.openxmlformats.org/markup-compatibility/2006"
 xmlns:d="
http://schemas.microsoft.com/expression/interactivedesigner/2005"
 c:Ignorable="d"
 x:Name="DocumentRoot"
 x:Class="UntitledProject1.Scene1"
 Width="640" Height="480">

 <Grid.Resources>
  <Storyboard x:Key="OnLoaded">
   <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" RepeatBehavior="Forever" Storyboard.TargetName="topCurve" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[5].(TranslateTransform.Y)">
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="70" KeyTime="00:00:00"/>
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="70" KeyTime="00:00:10"/>
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="0" KeyTime="00:00:20"/>
   </DoubleAnimationUsingKeyFrames>
   <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" RepeatBehavior="Forever" Storyboard.TargetName="bottomCurve" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[5].(TranslateTransform.Y)">
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="-50" KeyTime="00:00:00"/>
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="0" KeyTime="00:00:20"/>
   </DoubleAnimationUsingKeyFrames>
   <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" RepeatBehavior="Forever" Storyboard.TargetName="topCurve" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[5].(TranslateTransform.X)">
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="0" KeyTime="00:00:0"/>
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="-150" KeyTime="00:00:10"/>
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="0" KeyTime="00:00:20"/>
   </DoubleAnimationUsingKeyFrames>
   <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" RepeatBehavior="Forever" Storyboard.TargetName="topSlash" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[5].(TranslateTransform.Y)">
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="-10" KeyTime="00:00:10"/>
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="0" KeyTime="00:00:20"/>
   </DoubleAnimationUsingKeyFrames>
   <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" RepeatBehavior="Forever" Storyboard.TargetName="bottomSlash" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[5].(TranslateTransform.Y)">
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="10" KeyTime="00:00:10"/>
    <SplineDoubleKeyFrame d:KeyEase="Linear;Linear;0.5;0.5;0.5;0.5" KeySpline="0.5,0.5,0.5,0.5" Value="0" KeyTime="00:00:20"/>
   </DoubleAnimationUsingKeyFrames>   
  </Storyboard>
  <XmlDataProvider x:Key="TagsDS" d:IsDataSource="True" Source="C:\WinFX\Sean\RadialTree\RadialTree\Tags.xml"/>
  <HierarchicalDataTemplate x:Key="TagsHierTemplate" ItemsSource="{Binding XPath=Tag}">
   <StackPanel Orientation="Vertical" Background="{x:Null}">
   <Border BorderBrush="#FFFFFFFF" CornerRadius="7,0,0,7" BorderThickness="1,1,1,1" Padding="3,3,3,3">
    <StackPanel Orientation="Horizontal">
     <TextBlock FontSize="12" FontFamily="Calibri" Text="Tag: "/>
     <TextBlock FontSize="12" FontFamily="Calibri" Text="{Binding Mode=OneWay,
XPath=@name}"/>
    </StackPanel>
   </Border>
   <Border BorderBrush="#FFFFFFFF" CornerRadius="7,0,0,7" BorderThickness="1,1,1,1" Padding="3,3,3,3">
    <StackPanel Orientation="Horizontal">
     <TextBlock FontSize="12" FontFamily="Calibri" Text="Related Tags: " Foreground="sc#1, 0.0121860988, 0.0524424054, 0.3"/>
     <TextBlock FontSize="12" FontFamily="Calibri" Text="{Binding Mode=OneWay,
XPath=@relatedTags}" Foreground="sc#1, 0.0121748159, 0.05304598, 0.3"/>
    </StackPanel>
   </Border>
   </StackPanel>
  </HierarchicalDataTemplate>
 </Grid.Resources>

 <Grid.Triggers>
  <EventTrigger RoutedEvent="FrameworkElement.Loaded">
   <EventTrigger.Actions>
    <BeginStoryboard x:Name="OnLoaded_BeginStoryboard" Storyboard="{DynamicResource OnLoaded}"/>
   </EventTrigger.Actions>
  </EventTrigger>
 
 </Grid.Triggers>
 
 <Grid.ColumnDefinitions>
  <ColumnDefinition Width="*"/>
 </Grid.ColumnDefinitions>
 <Grid.RowDefinitions>
  <RowDefinition/>
 </Grid.RowDefinitions>
 <Grid.Background>
  <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
   <LinearGradientBrush.RelativeTransform>
    <TransformGroup>
     <TranslateTransform X="-0.5" Y="-0.5"/>
     <ScaleTransform ScaleX="1" ScaleY="1"/>
     <SkewTransform AngleX="0" AngleY="0"/>
     <RotateTransform Angle="90.495202139271512" CenterX="0" CenterY="0"/>
     <TranslateTransform X="0.5" Y="0.5"/>
     <TranslateTransform X="5.5511151231257827E-17" Y="5.5511151231257827E-17"/>
    </TransformGroup>
   </LinearGradientBrush.RelativeTransform>
   <LinearGradientBrush.GradientStops>
    <GradientStopCollection>
     <GradientStop Color="sc#1, 0.0217442848, 0.0835272, 0.6380811" Offset="0.10999281092739174"/>
     <GradientStop Color="sc#1, 0.06484591, 0.340538949, 0.9888191" Offset="1"/>
    </GradientStopCollection>
   </LinearGradientBrush.GradientStops>
  </LinearGradientBrush>
 </Grid.Background>
 <TreeView FontFamily="Segoe UI" Width="Auto" Height="Auto" x:Name="TreeView" MinWidth="0" RenderTransformOrigin="2.26666666666667,2.43684210526316" Margin="82,67.0000000000001,127,78.9999999999999" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" MinHeight="0" Background="sc#0.273407549, 1, 1, 1" ItemTemplate="{DynamicResource TagsHierTemplate}">
  <TreeView.RenderTransform>
   <TransformGroup>
    <TranslateTransform X="0" Y="0"/>
    <ScaleTransform ScaleX="1" ScaleY="1"/>
    <SkewTransform AngleX="0" AngleY="0"/>
    <RotateTransform Angle="0" CenterX="0" CenterY="0"/>
    <TranslateTransform X="0" Y="0"/>
    <TranslateTransform X="0" Y="0"/>
   </TransformGroup>
  </TreeView.RenderTransform>
  <TreeView.ItemsSource>
   <Binding Mode="Default" Source="{StaticResource TagsDS}" XPath="/Tags/Tag"/>
  </TreeView.ItemsSource>
 </TreeView>
 <Path Fill="#FFFFFFFF" StrokeThickness="20" Width="Auto" Height="57.5" Opacity="0.75" HorizontalAlignment="Stretch" VerticalAlignment="Top" Grid.ColumnSpan="1" MinWidth="0" Margin="-12,112.5,-17,0" d:IsLocked="True" x:Name="topSlash" RenderTransformOrigin="0.5,0.5" Stretch="Fill">
  <Path.Stroke>
   <LinearGradientBrush StartPoint="0,0.5" EndPoint="1,0.5">
    <LinearGradientBrush.RelativeTransform>
     <TransformGroup>
      <TranslateTransform X="-0.5" Y="-0.5"/>
      <ScaleTransform ScaleX="1.2435054172657669" ScaleY="1.2435054172657669"/>
 &