-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathCodegenPage.xaml
83 lines (80 loc) · 4.1 KB
/
CodegenPage.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<Page x:Class="LottieSamples.Scenarios.CodegenPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:animatedvisuals="using:AnimatedVisuals"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:muxc="using:Microsoft.UI.Xaml.Controls"
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
mc:Ignorable="d">
<Grid>
<StackPanel VerticalAlignment="Center">
<!--#region IntroText-->
<StackPanel Style="{StaticResource IntroTextContainer}">
<RichTextBlock>
<Paragraph>
While Lottie animations on other platforms require you to use a json file,
Lottie-Windows allows you to use a codegen'd class which provides better performance.
You'll need to
<Span FontWeight="SemiBold">include</Span>:
<LineBreak />
</Paragraph>
</RichTextBlock>
<RichTextBlock Style="{StaticResource IndentedText}">
<Paragraph>
•
<Hyperlink NavigateUri="https://www.nuget.org/packages/Microsoft.UI.Xaml/">
<Span FontFamily="Consolas">Microsoft.UI.Xaml.Controls.AnimatedVisualPlayer</Span>
</Hyperlink>
</Paragraph>
<Paragraph>
•
<Hyperlink NavigateUri="https://www.nuget.org/packages/Win2D.uwp/">
<Span FontFamily="Consolas">Microsoft.Graphics.Canvas</Span>
</Hyperlink>
if codegen-ing C#.
</Paragraph>
<Paragraph>
•
<Span FontFamily="Consolas">AnimatedVisuals/LottieLogo1.cs</Span>
which was generated from
<Span FontFamily="Consolas">LottieLogo1.json</Span> using the
<Hyperlink NavigateUri="https://aka.ms/lottiegen">
LottieGen CLI
</Hyperlink>.
<LineBreak/>
</Paragraph>
</RichTextBlock>
</StackPanel>
<!--#endregion-->
<Border Style="{StaticResource LottiePlayer}">
<!-- AnimatedVisualPlayer with AutoPlay -->
<muxc:AnimatedVisualPlayer x:Name="Codegen_Player"
AutomationProperties.Name="Lottie animation">
<!-- Codegen source with C# class: AnimatedVisuals/LottieLogo1.cs -->
<animatedvisuals:LottieLogo1 />
</muxc:AnimatedVisualPlayer>
</Border>
<!--#region OutroText-->
<RichTextBlock Style="{StaticResource OutroTextBlock}">
<Paragraph>
To learn more, check out the
<Hyperlink NavigateUri="https://github.com/windows-toolkit/Lottie-Windows/blob/master/samples/LottieSamples/Scenarios/CodegenPage.xaml">
XAML
</Hyperlink>
and read
<Hyperlink NavigateUri="https://docs.microsoft.com/windows/communitytoolkit/animations/lottie-scenarios/getting_started_codegen">
this tutorial
</Hyperlink>
on using codegen classes with Lottie-Windows and a comparison of the
<Hyperlink NavigateUri="https://docs.microsoft.com/windows/communitytoolkit/animations/lottie-scenarios/json_codegen">
JSON v/s Codegen
</Hyperlink>
approaches.
<LineBreak />
</Paragraph>
</RichTextBlock>
<!--#endregion-->
</StackPanel>
</Grid>
</Page>