Browse Source

Some tweaking with AnimationPage.xaml.

Merged RenderTest's Program and App class for brevity.
pull/1461/head
Jumar Macato 8 years ago
parent
commit
1fbf8ee796
  1. 13
      samples/RenderTest/App.xaml.cs
  2. 12
      samples/RenderTest/Pages/AnimationsPage.xaml
  3. 24
      samples/RenderTest/Program.cs

13
samples/RenderTest/App.xaml.cs

@ -2,6 +2,7 @@
// Licensed under the MIT license. See licence.md file in the project root for full license information.
using Avalonia;
using Avalonia.Logging.Serilog;
using Avalonia.Markup.Xaml;
namespace RenderTest
@ -12,5 +13,17 @@ namespace RenderTest
{
AvaloniaXamlLoader.Load(this);
}
// TODO: Make this work with GTK/Skia/Cairo depending on command-line args
// again.
static void Main(string[] args) => BuildAvaloniaApp().Start<MainWindow>();
// App configuration, used by the entry point and previewer
static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.UseReactiveUI()
.LogToDebug();
}
}

12
samples/RenderTest/Pages/AnimationsPage.xaml

@ -37,11 +37,13 @@
<Style.Animations>
<Animation Duration="0:0:0.5" Easing="SineEaseInOut">
<TransformKeyFrames Property="ScaleTransform.ScaleX">
<KeyFrame Cue="0%" Value="0.8"/>
<KeyFrame Cue="0%" Value="1"/>
<KeyFrame Cue="50%" Value="0.8"/>
<KeyFrame Cue="100%" Value="1"/>
</TransformKeyFrames>
<TransformKeyFrames Property="ScaleTransform.ScaleY">
<KeyFrame Cue="0%" Value="0.8"/>
<KeyFrame Cue="0%" Value="1"/>
<KeyFrame Cue="50%" Value="0.8"/>
<KeyFrame Cue="100%" Value="1"/>
</TransformKeyFrames>
</Animation>
@ -73,14 +75,14 @@
</Styles>
</UserControl.Styles>
<Grid>
<StackPanel>
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center" ClipToBounds="False">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<TextBlock VerticalAlignment="Center">
Hover to activate Transform Keyframe Animations.
</TextBlock>
<Button Content="{Binding PlayStateText}" Command="{Binding ToggleGlobalPlayState}"/>
</StackPanel>
<WrapPanel>
<WrapPanel ClipToBounds="False">
<Border Classes="Test Rect1" Background="DarkRed">
<Border.RenderTransform>
<TransformGroup>
@ -91,7 +93,7 @@
</Border>
<Border Classes="Test Rect2" Background="DarkMagenta">
<Border.RenderTransform>
<ScaleTransform ScaleX="0.8" ScaleY="0.8"/>
<ScaleTransform/>
</Border.RenderTransform>
</Border>
<Border Classes="Test Rect3" Background="Navy" >

24
samples/RenderTest/Program.cs

@ -1,24 +0,0 @@
using System;
using System.Linq;
using Avalonia;
using Avalonia.Controls;
using Avalonia.Logging.Serilog;
using Avalonia.Platform;
using Serilog;
namespace RenderTest
{
internal class Program
{
// TODO: Make this work with GTK/Skia/Cairo depending on command-line args
// again.
static void Main(string[] args) => BuildAvaloniaApp().Start<MainWindow>();
// App configuration, used by the entry point and previewer
static AppBuilder BuildAvaloniaApp()
=> AppBuilder.Configure<App>()
.UsePlatformDetect()
.UseReactiveUI()
.LogToDebug();
}
}
Loading…
Cancel
Save