public static readonly BindableProperty ThicknessProperty = BindableProperty.Create(nameof(Thickness), typeof(float), typeof(CircularProgress), default(float), propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = ((CircularProgress)bindable);
+ instance.CurrentStyle.Thickness = (float)newValue;
instance.UpdateVisualThickness((float)newValue);
},
defaultValueCreator: (bindable) =>
{
- var instance = (CircularProgress)bindable;
- return instance.trackVisual == null ? 0 : instance.trackVisual.Thickness;
+ return ((CircularProgress)bindable).CurrentStyle.Thickness;
});
/// <summary>Bindable property of MaxValue</summary>
public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(CircularProgress), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = (CircularProgress)bindable;
+ instance.CurrentStyle.TrackColor = (Color)newValue;
instance.UpdateTrackVisualColor((Color)newValue);
},
defaultValueCreator: (bindable) =>
{
- return ((CircularProgress)bindable).trackVisual?.MixColor;
+ return ((CircularProgress)bindable).CurrentStyle.TrackColor;
});
/// <summary>Bindable property of ProgressColor</summary>
public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create(nameof(ProgressColor), typeof(Color), typeof(CircularProgress), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = (CircularProgress)bindable;
+ instance.CurrentStyle.ProgressColor = (Color)newValue;
instance.UpdateProgressVisualColor((Color)newValue);
},
defaultValueCreator: (bindable) =>
{
- return ((CircularProgress)bindable).progressVisual?.MixColor;
+ return ((CircularProgress)bindable).CurrentStyle.ProgressColor;
});
/// <summary>Bindable property of IsEnabled</summary>
}
}
+ private CircularProgressStyle CurrentStyle => ViewStyle as CircularProgressStyle;
+
#endregion Properties
public static readonly BindableProperty ThicknessProperty = BindableProperty.Create(nameof(Thickness), typeof(float), typeof(CircularScrollbar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = ((CircularScrollbar)bindable);
- instance.UpdateVisualThickness((float?)newValue ?? 0);
+ float value = (float?)newValue ?? 0;
+ instance.CurrentStyle.Thickness = value;
+ instance.UpdateVisualThickness(value);
},
defaultValueCreator: (bindable) =>
{
var instance = (CircularScrollbar)bindable;
- return instance.trackVisual == null ? 0 : instance.trackVisual.Thickness;
+ return instance.CurrentStyle.Thickness ?? 0;
});
/// <summary>Bindable property of TrackSweepAngle</summary>
public static readonly BindableProperty TrackSweepAngleProperty = BindableProperty.Create(nameof(TrackSweepAngle), typeof(float), typeof(CircularScrollbar), default(float), propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = ((CircularScrollbar)bindable);
- instance.UpdateTrackVisualSweepAngle((float?)newValue ?? 0);
+ float value = (float?)newValue ?? 0;
+ instance.CurrentStyle.TrackSweepAngle = value;
+ instance.UpdateTrackVisualSweepAngle(value);
},
defaultValueCreator: (bindable) =>
{
var instance = (CircularScrollbar)bindable;
- return instance.trackVisual == null ? 0 : instance.trackVisual.SweepAngle;
+ return instance.CurrentStyle.TrackSweepAngle ?? 0;
});
/// <summary>Bindable property of TrackColor</summary>
public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(CircularScrollbar), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = ((CircularScrollbar)bindable);
+ instance.CurrentStyle.TrackColor = (Color)newValue;
instance.UpdateTrackVisualColor((Color)newValue);
},
defaultValueCreator: (bindable) =>
{
- return ((CircularScrollbar)bindable).trackVisual?.MixColor;
+ return ((CircularScrollbar)bindable).CurrentStyle.TrackColor;
});
/// <summary>Bindable property of ThumbColor</summary>
public static readonly BindableProperty ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(CircularScrollbar), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = ((CircularScrollbar)bindable);
+ instance.CurrentStyle.ThumbColor = (Color)newValue;
instance.UpdateThumbVisualColor((Color)newValue);
},
defaultValueCreator: (bindable) =>
{
- return ((CircularScrollbar)bindable).thumbVisual?.MixColor;
+ return ((CircularScrollbar)bindable).CurrentStyle.ThumbColor;
});
private ArcVisual trackVisual;
/// Style setting is possible by using constructor or the function of ApplyStyle(ViewStyle viewStyle)
/// </remarks>
[EditorBrowsable(EditorBrowsableState.Never)]
- public new CircularScrollbarStyle Style
+ public CircularScrollbarStyle Style
{
get
{
set => SetValue(ThumbColorProperty, value);
}
+ private CircularScrollbarStyle CurrentStyle => ViewStyle as CircularScrollbarStyle;
+
#endregion Properties
public static readonly BindableProperty ThicknessProperty = BindableProperty.Create(nameof(Thickness), typeof(float), typeof(CircularSlider), default(float), propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = ((CircularSlider)bindable);
+ instance.CurrentStyle.Thickness = (float)newValue;
instance.UpdateVisualThickness((float)newValue);
},
defaultValueCreator: (bindable) =>
{
- var instance = (CircularSlider)bindable;
- return instance.trackVisual == null ? 0 : instance.trackVisual.Thickness;
+ return ((CircularSlider)bindable).CurrentStyle.Thickness;
});
/// <summary>Bindable property of MaxValue</summary>
public static readonly BindableProperty TrackColorProperty = BindableProperty.Create(nameof(TrackColor), typeof(Color), typeof(CircularSlider), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = (CircularSlider)bindable;
+ instance.CurrentStyle.TrackColor = (Color)newValue;
instance.UpdateTrackVisualColor((Color)newValue);
},
defaultValueCreator: (bindable) =>
{
- return ((CircularSlider)bindable).trackVisual?.MixColor;
+ return ((CircularSlider)bindable).CurrentStyle.TrackColor;
});
/// <summary>Bindable property of ProgressColor</summary>
public static readonly BindableProperty ProgressColorProperty = BindableProperty.Create(nameof(ProgressColor), typeof(Color), typeof(CircularSlider), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = (CircularSlider)bindable;
+ instance.CurrentStyle.ProgressColor = (Color)newValue;
instance.UpdateProgressVisualColor((Color)newValue);
},
defaultValueCreator: (bindable) =>
{
- return ((CircularSlider)bindable).progressVisual?.MixColor;
+ return ((CircularSlider)bindable).CurrentStyle.ProgressColor;
});
/// <summary>Bindable property of ThumbSize</summary>
public static readonly BindableProperty ThumbColorProperty = BindableProperty.Create(nameof(ThumbColor), typeof(Color), typeof(CircularSlider), null, propertyChanged: (bindable, oldValue, newValue) =>
{
var instance = (CircularSlider)bindable;
+ instance.CurrentStyle.ThumbColor = (Color)newValue;
instance.UpdateThumbVisualColor((Color)newValue);
},
defaultValueCreator: (bindable) =>
{
- return ((CircularSlider)bindable).thumbVisual?.MixColor;
+ return ((CircularSlider)bindable).CurrentStyle.ThumbColor;
});
/// <summary>Bindable property of IsEnabled</summary>
}
}
+ private CircularSliderStyle CurrentStyle => ViewStyle as CircularSliderStyle;
+
#endregion Properties