Created
May 31, 2020 22:43
-
-
Save TheFo2sh/88ccc55df76db74ec7fbf9c71b900f08 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public partial class CircularProgressbarView: ContentView | |
{ | |
private ProgressDrawer _ProgressDrawer; | |
public static readonly BindableProperty ProgressProperty = BindableProperty.Create( | |
"Progress", typeof(double), typeof(CircularProgressbarView),propertyChanged:OnProgressChanged); | |
public double Progress | |
{ | |
get { return (double) GetValue(ProgressProperty); } | |
set { SetValue(ProgressProperty, value); } | |
} | |
private static void OnProgressChanged(BindableObject bindable, object oldvalue, object newvalue) | |
{ | |
var context = bindable as vxaml; | |
context.SkCanvasView.InvalidateSurface(); | |
} | |
public CircularProgressbarView() | |
{ | |
InitializeComponent(); | |
var circle = new Circle(400,(info)=> new SKPoint((float)info.Width / 2,(float)info.Height / 2)); | |
_ProgressDrawer = new ProgressDrawer(SkCanvasView, circle, () => (float)Progress, 5,SKColors.Black, SKColors.Red); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment