Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion SkeletonExample/SkeletonExample/Pages/Page2.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
sk:Skeleton.IsParent="True"
sk:Skeleton.IsBusy="{Binding IsBusy}"
sk:Skeleton.BackgroundColor="{StaticResource BlueColor}"
sk:Skeleton.Animation="{sk:DefaultAnimation Beat}">
sk:Skeleton.Animation="Beat">
<StackLayout Spacing="16"
Orientation="Horizontal">

Expand Down
2 changes: 1 addition & 1 deletion SkeletonExample/SkeletonExample/Pages/Page3.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
sk:Skeleton.IsParent="True"
sk:Skeleton.IsBusy="{Binding IsBusy}"
sk:Skeleton.BackgroundColor="{StaticResource BlueColor}"
sk:Skeleton.Animation="{sk:DefaultAnimation Fade}">
sk:Skeleton.Animation="Fade">
<StackLayout Spacing="16"
Orientation="Horizontal">

Expand Down
2 changes: 1 addition & 1 deletion SkeletonExample/SkeletonExample/Pages/Page4.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
sk:Skeleton.IsParent="True"
sk:Skeleton.IsBusy="{Binding IsBusy}"
sk:Skeleton.BackgroundColor="{StaticResource BlueColor}"
sk:Skeleton.Animation="{sk:DefaultAnimation VerticalShake}">
sk:Skeleton.Animation="VerticalShake">
<StackLayout Spacing="16"
Orientation="Horizontal">

Expand Down
2 changes: 1 addition & 1 deletion SkeletonExample/SkeletonExample/Pages/Page5.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
sk:Skeleton.IsParent="True"
sk:Skeleton.IsBusy="{Binding IsBusy}"
sk:Skeleton.BackgroundColor="{StaticResource BlueColor}"
sk:Skeleton.Animation="{sk:DefaultAnimation HorizontalShake}">
sk:Skeleton.Animation="HorizontalShake">
<StackLayout Spacing="16"
Orientation="Horizontal">

Expand Down
14 changes: 14 additions & 0 deletions Xamarin.Forms.Skeleton/Animations/BaseAnimationTypeConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
using System;

namespace Xamarin.Forms.Skeleton.Animations
{
[Xaml.TypeConversion(typeof(BaseAnimation))]
public class BaseAnimationTypeConverter : TypeConverter
{
public override object ConvertFromInvariantString(string value)
{
var type = (AnimationTypes)Enum.Parse(typeof(AnimationTypes), value);
return new DefaultAnimationExtension() { Source = type }.ProvideValue(null);
}
}
}
2 changes: 2 additions & 0 deletions Xamarin.Forms.Skeleton/Skeleton.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,10 @@ public static class Skeleton

public static readonly BindableProperty AnimationProperty = BindableProperty.CreateAttached("Animation", typeof(BaseAnimation), typeof(View), null);

[TypeConverter(typeof(BaseAnimationTypeConverter))]
public static void SetAnimation(BindableObject b, BaseAnimation value) => b.SetValue(AnimationProperty, value);

[TypeConverter(typeof(BaseAnimationTypeConverter))]
public static BaseAnimation GetAnimation(BindableObject b) => (BaseAnimation)b.GetValue(AnimationProperty);

#endregion Public Properties
Expand Down