|
@@ -6,7 +6,8 @@
|
|
|
xmlns:behaviours="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Behaviours"
|
|
|
xmlns:commands="clr-namespace:PixiEditor.AvaloniaUI.Models.Commands.Attributes.Commands"
|
|
|
xmlns:xaml="clr-namespace:PixiEditor.AvaloniaUI.Models.Commands.XAML"
|
|
|
- xmlns:converters="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Converters">
|
|
|
+ xmlns:converters="clr-namespace:PixiEditor.AvaloniaUI.Helpers.Converters"
|
|
|
+ xmlns:ui="clr-namespace:PixiEditor.AvaloniaUI.Helpers.UI">
|
|
|
<Design.PreviewWith>
|
|
|
<animations:Timeline>
|
|
|
<animations:Timeline.KeyFrames>
|
|
@@ -18,7 +19,7 @@
|
|
|
<ControlTheme TargetType="animations:Timeline" x:Key="{x:Type animations:Timeline}">
|
|
|
<Setter Property="Template">
|
|
|
<ControlTemplate>
|
|
|
- <Grid Background="{DynamicResource ThemeBackgroundBrush1}">
|
|
|
+ <Grid Background="{DynamicResource ThemeBackgroundBrush1}">
|
|
|
<Grid.RowDefinitions>
|
|
|
<RowDefinition Height="Auto" />
|
|
|
<RowDefinition Height="Auto" />
|
|
@@ -74,46 +75,61 @@
|
|
|
</animations:TimelineSlider>
|
|
|
</DockPanel>
|
|
|
|
|
|
- <ScrollViewer Background="{DynamicResource ThemeBackgroundBrush}" Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="2" HorizontalScrollBarVisibility="Auto">
|
|
|
- <TreeView ItemsSource="{TemplateBinding KeyFrames}">
|
|
|
- <TreeView.ItemContainerTheme>
|
|
|
- <ControlTheme TargetType="TreeViewItem">
|
|
|
- <Setter Property="ClipToBounds" Value="False" />
|
|
|
- <Setter Property="Template">
|
|
|
- <ControlTemplate>
|
|
|
- <StackPanel Orientation="Horizontal">
|
|
|
- <ContentPresenter Name="PART_HeaderPresenter" Margin="0" Padding="0"
|
|
|
- Background="Transparent"
|
|
|
- HorizontalContentAlignment="{TemplateBinding HorizontalAlignment}"
|
|
|
- Content="{TemplateBinding Header}"
|
|
|
- ContentTemplate="{TemplateBinding HeaderTemplate}"
|
|
|
- Focusable="False" />
|
|
|
- <ItemsPresenter Name="PART_ItemsPresenter">
|
|
|
- <ItemsPresenter.ItemsPanel>
|
|
|
- <ItemsPanelTemplate>
|
|
|
- <StackPanel Orientation="Horizontal" />
|
|
|
- </ItemsPanelTemplate>
|
|
|
- </ItemsPresenter.ItemsPanel>
|
|
|
- </ItemsPresenter>
|
|
|
- </StackPanel>
|
|
|
- </ControlTemplate>
|
|
|
- </Setter>
|
|
|
- </ControlTheme>
|
|
|
- </TreeView.ItemContainerTheme>
|
|
|
- <TreeView.DataTemplates>
|
|
|
- <TreeDataTemplate DataType="document:KeyFrameGroupViewModel"
|
|
|
- ItemsSource="{Binding Children}">
|
|
|
- <Grid Width="200">
|
|
|
- <TextBlock Text="{Binding StartFrame}" />
|
|
|
- </Grid>
|
|
|
- </TreeDataTemplate>
|
|
|
- <DataTemplate DataType="document:RasterKeyFrameViewModel">
|
|
|
- <animations:KeyFrame Margin="0 10"
|
|
|
- Scale="{Binding Scale, RelativeSource={RelativeSource FindAncestor, AncestorType=animations:Timeline}}"
|
|
|
- Item="{Binding}" />
|
|
|
- </DataTemplate>
|
|
|
- </TreeView.DataTemplates>
|
|
|
- </TreeView>
|
|
|
+ <ScrollViewer Background="{DynamicResource ThemeBackgroundBrush}" Grid.Column="0"
|
|
|
+ Grid.ColumnSpan="2" Grid.Row="2" HorizontalScrollBarVisibility="Auto">
|
|
|
+ <TreeView ItemsSource="{TemplateBinding KeyFrames}">
|
|
|
+ <TreeView.ItemContainerTheme>
|
|
|
+ <ControlTheme TargetType="TreeViewItem">
|
|
|
+ <Setter Property="ClipToBounds" Value="False" />
|
|
|
+ <Setter Property="Margin">
|
|
|
+ <MultiBinding Converter="{converters:DurationToMarginConverter}">
|
|
|
+ <Binding Path="DataContext.StartFrame" RelativeSource="{RelativeSource Self}" />
|
|
|
+ <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=animations:Timeline}" Path="Scale" />
|
|
|
+ </MultiBinding>
|
|
|
+ </Setter>
|
|
|
+ <Setter Property="Template">
|
|
|
+ <ControlTemplate>
|
|
|
+ <StackPanel Orientation="Horizontal">
|
|
|
+ <ContentPresenter Name="PART_HeaderPresenter" Margin="0"
|
|
|
+ Padding="0"
|
|
|
+ Background="Transparent"
|
|
|
+ HorizontalContentAlignment="{TemplateBinding HorizontalAlignment}"
|
|
|
+ Content="{TemplateBinding Header}"
|
|
|
+ ContentTemplate="{TemplateBinding HeaderTemplate}"
|
|
|
+ Focusable="False" />
|
|
|
+ <ItemsPresenter Name="PART_ItemsPresenter">
|
|
|
+ <ItemsPresenter.ItemsPanel>
|
|
|
+ <ItemsPanelTemplate>
|
|
|
+ <Grid/>
|
|
|
+ </ItemsPanelTemplate>
|
|
|
+ </ItemsPresenter.ItemsPanel>
|
|
|
+ </ItemsPresenter>
|
|
|
+ </StackPanel>
|
|
|
+ </ControlTemplate>
|
|
|
+ </Setter>
|
|
|
+ </ControlTheme>
|
|
|
+ </TreeView.ItemContainerTheme>
|
|
|
+ <TreeView.DataTemplates>
|
|
|
+ <TreeDataTemplate DataType="document:KeyFrameGroupViewModel"
|
|
|
+ ItemsSource="{Binding Children}">
|
|
|
+ <Grid Width="200">
|
|
|
+ <TextBlock Text="{Binding StartFrame}" />
|
|
|
+ </Grid>
|
|
|
+ </TreeDataTemplate>
|
|
|
+ <DataTemplate DataType="document:RasterKeyFrameViewModel">
|
|
|
+ <animations:KeyFrame Margin="0 10"
|
|
|
+ Scale="{Binding Scale, RelativeSource={RelativeSource FindAncestor, AncestorType=animations:Timeline}}"
|
|
|
+ Item="{Binding}">
|
|
|
+ <animations:KeyFrame.Width>
|
|
|
+ <MultiBinding Converter="{converters:DurationToWidthConverter}">
|
|
|
+ <Binding Path="Duration" />
|
|
|
+ <Binding RelativeSource="{RelativeSource FindAncestor, AncestorType=animations:Timeline}" Path="Scale" />
|
|
|
+ </MultiBinding>
|
|
|
+ </animations:KeyFrame.Width>
|
|
|
+ </animations:KeyFrame>
|
|
|
+ </DataTemplate>
|
|
|
+ </TreeView.DataTemplates>
|
|
|
+ </TreeView>
|
|
|
</ScrollViewer>
|
|
|
</Grid>
|
|
|
</ControlTemplate>
|