Browse Source

Rename IterationCount.Loop to IterationCount.Infinite to abide byCSS's equivalent property.

Jumar Macato 7 years ago
parent
commit
41b6fdc62a

+ 1 - 1
samples/RenderDemo/Pages/AnimationsPage.xaml

@@ -73,7 +73,7 @@ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
         <Style.Animations>
           <Animation Duration="0:0:0.5"
                      Easing="QuadraticEaseInOut"
-                     IterationCount="Loop">
+                     IterationCount="Infinite">
             <KeyFrame Cue="50%">
               <Setter Property="ScaleTransform.ScaleX" Value="0.8"/>
               <Setter Property="ScaleTransform.ScaleY" Value="0.8"/>

+ 1 - 1
samples/RenderDemo/Pages/ClippingPage.xaml

@@ -8,7 +8,7 @@ xmlns="https://github.com/avaloniaui">
         </Style>
         <Style Selector="Border#clipChild">
           <Style.Animations>
-            <Animation Duration="0:0:2" IterationCount="Loop">
+            <Animation Duration="0:0:2" IterationCount="Infinite">
               <KeyFrame Cue="100%">
                 <Setter Property="RotateTransform.Angle" Value="360"/>
               </KeyFrame>

+ 8 - 8
src/Avalonia.Animation/IterationCount.cs

@@ -13,7 +13,7 @@ namespace Avalonia.Animation
     public enum IterationType
     {
         Many,
-        Loop
+        Infinite
     }
 
     /// <summary>
@@ -42,7 +42,7 @@ namespace Avalonia.Animation
         /// <param name="type">The unit of the IterationCount.</param>
         public IterationCount(ulong value, IterationType type)
         {
-            if (type > IterationType.Loop)
+            if (type > IterationType.Infinite)
             {
                 throw new ArgumentException("Invalid value", "type");
             }
@@ -55,7 +55,7 @@ namespace Avalonia.Animation
         /// Gets an instance of <see cref="IterationCount"/> that indicates that an animation
         /// should repeat forever.
         /// </summary>
-        public static IterationCount Loop => new IterationCount(0, IterationType.Loop);
+        public static IterationCount Loop => new IterationCount(0, IterationType.Infinite);
 
         /// <summary>
         /// Gets the unit of the <see cref="IterationCount"/>.
@@ -65,7 +65,7 @@ namespace Avalonia.Animation
         /// <summary>
         /// Gets a value that indicates whether the <see cref="IterationCount"/> is set to loop.
         /// </summary>
-        public bool IsLoop => _type == IterationType.Loop;
+        public bool IsInfinite => _type == IterationType.Infinite;
 
         /// <summary>
         /// Gets the number of repeat iterations.
@@ -80,7 +80,7 @@ namespace Avalonia.Animation
         /// <returns>True if the structures are equal, otherwise false.</returns>
         public static bool operator ==(IterationCount a, IterationCount b)
         {
-            return (a.IsLoop && b.IsLoop)
+            return (a.IsInfinite && b.IsInfinite)
                 || (a._value == b._value && a._type == b._type);
         }
 
@@ -140,9 +140,9 @@ namespace Avalonia.Animation
         /// <returns>The string representation.</returns>
         public override string ToString()
         {
-            if (IsLoop)
+            if (IsInfinite)
             {
-                return "Loop";
+                return "Infinite";
             }
 
             string s = _value.ToString();
@@ -158,7 +158,7 @@ namespace Avalonia.Animation
         {
             s = s.ToUpperInvariant().Trim();
 
-            if (s.EndsWith("LOOP"))
+            if (s.EndsWith("INFINITE"))
             {
                 return Loop;
             }

+ 2 - 2
src/Avalonia.Themes.Default/ProgressBar.xaml

@@ -33,7 +33,7 @@
   <Style Selector="ProgressBar:horizontal:indeterminate /template/ Border#PART_Indicator">
       <Style.Animations>
           <Animation Duration="0:0:3"
-                     IterationCount="Loop"
+                     IterationCount="Infinite"
                      Easing="LinearEasing">
               <KeyFrame Cue="0%">
                   <Setter Property="TranslateTransform.X"
@@ -49,7 +49,7 @@
   <Style Selector="ProgressBar:vertical:indeterminate /template/ Border#PART_Indicator">
       <Style.Animations>
           <Animation Duration="0:0:3"
-                     IterationCount="Loop"
+                     IterationCount="Infinite"
                      Easing="LinearEasing">
               <KeyFrame Cue="0%">
                   <Setter Property="TranslateTransform.Y"