forked from CommunityToolkit/Lottie-Windows
-
Notifications
You must be signed in to change notification settings - Fork 0
/
PropertiesTemplateSelector.cs
37 lines (31 loc) · 992 Bytes
/
PropertiesTemplateSelector.cs
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
// Licensed to the .NET Foundation under one or more agreements.
// The .NET Foundation licenses this file to you under the MIT license.
// See the LICENSE file in the project root for more information.
#nullable enable
using LottieViewer.ViewModel;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace LottieViewer
{
public sealed class PropertiesTemplateSelector : DataTemplateSelector
{
public DataTemplate? Normal { get; set; }
public DataTemplate? Marker { get; set; }
public DataTemplate? MarkerWithDuration { get; set; }
protected override DataTemplate? SelectTemplateCore(object item, DependencyObject container)
{
if (item is PairOfStrings)
{
return Normal;
}
else if (item is Marker)
{
return Marker;
}
else
{
return MarkerWithDuration;
}
}
}
}