[EditorBrowsable(EditorBrowsableState.Never)]
public static readonly BindableProperty FrameRateProperty = BindableProperty.Create(nameof(FrameRate), typeof(int), typeof(Loading), (int)(1000 / 16.6f), propertyChanged: (bindable, oldValue, newValue) =>
{
- Debug.Assert(((Loading)bindable).imageVisual != null);
+ var instance = (Loading)bindable;
+ Debug.Assert(instance.imageVisual != null);
- int frameRate = (int)newValue;
- if (0 != frameRate) //It will crash if 0
+ instance.frameRate = (int)newValue;
+ if (0 != instance.frameRate) //It will crash if 0
{
- ((Loading)bindable).imageVisual.FrameDelay = 1000.0f / frameRate;
+ instance.imageVisual.FrameDelay = instance.frameRate;
}
},
defaultValueCreator: (bindable) =>
{
- Debug.Assert(((Loading)bindable).imageVisual != null);
- return ((Loading)bindable).imageVisual.FrameDelay * 1000.0f;
+ return ((Loading)bindable).frameRate;
});
private AnimatedImageVisual imageVisual = null;
+ private int frameRate = (int)(1000 / 16.6f);
internal new class Property
{
/// Gets or sets the count of the pages/indicators.
/// </summary>
/// <since_tizen> 8 </since_tizen>
+ /// <exception cref="ArgumentException">Thrown when the given value is negative.</exception>
public int IndicatorCount
{
get
}
set
{
- if (indicatorCount == value || value < 0)
+ if (value < 0)
+ {
+ throw new ArgumentException($"Setting {nameof(IndicatorCount)} to negative is not allowed.");
+ }
+
+ if (indicatorCount == value)
{
return;
}
selectedIndicatorColor = value;
}
- if (selectedIndex == -1)
+ if (indicatorList.Count > selectedIndex)
{
- return;
+ var indicator = indicatorList[selectedIndex];
+ indicator.MixColor = selectedIndicatorColor;
+ indicator.Opacity = selectedIndicatorColor.A;
}
-
- ImageVisual indicator = indicatorList[selectedIndex];
- indicator.MixColor = selectedIndicatorColor;
- indicator.Opacity = selectedIndicatorColor.A;
}
}
Selected = FrameworkInformation.ResourcePath + "nui_component_default_pagination_focus_dot.png",
},
IndicatorSize = new Size(10, 10),
- IndicatorSpacing = 10,
});
theme.AddStyleWithoutClone("Tizen.NUI.Components.Scrollbar", new ScrollbarStyle()