Skip to content

Instantly share code, notes, and snippets.

@TheFo2sh
Created May 31, 2020 22:43
Show Gist options
  • Save TheFo2sh/88ccc55df76db74ec7fbf9c71b900f08 to your computer and use it in GitHub Desktop.
Save TheFo2sh/88ccc55df76db74ec7fbf9c71b900f08 to your computer and use it in GitHub Desktop.
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