Advertisement
Guest User

Untitled

a guest
Jun 20th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. public void ShowProgressBar(string title, string message, int max, int progress)
  2. {
  3. Device.BeginInvokeOnMainThread(() =>
  4. {
  5. dialog = new ProgressDialog(Plugin.CurrentActivity.CrossCurrentActivity.Current.Activity);
  6. dialog.SetTitle(title);
  7. //dialog.SetMessage(message);
  8. dialog.SetProgressStyle(ProgressDialogStyle.Horizontal);
  9. dialog.Max = max;
  10. dialog.Progress = 0;
  11. dialog.Show();
  12. });
  13. }
  14.  
  15. public void UpdateProgressBar(string message, int max, int progress)
  16. {
  17. Device.BeginInvokeOnMainThread(() =>
  18. {
  19. if (dialog != null)
  20. {
  21. dialog.IncrementProgressBy(progress);
  22. dialog.SetCanceledOnTouchOutside(false);
  23. dialog.SetCancelable(false);
  24. }
  25. });
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement