|
@@ -13,7 +13,7 @@ namespace UICatalog {
|
|
private ProgressBar _activityProgressBar;
|
|
private ProgressBar _activityProgressBar;
|
|
private ProgressBar _pulseProgressBar;
|
|
private ProgressBar _pulseProgressBar;
|
|
private Timer _timer;
|
|
private Timer _timer;
|
|
- private object _timeoutToken;
|
|
|
|
|
|
+ private object _timeoutToken = null;
|
|
|
|
|
|
public override void Setup ()
|
|
public override void Setup ()
|
|
{
|
|
{
|
|
@@ -59,7 +59,9 @@ namespace UICatalog {
|
|
{
|
|
{
|
|
_timer?.Dispose ();
|
|
_timer?.Dispose ();
|
|
_timer = null;
|
|
_timer = null;
|
|
- Application.MainLoop.RemoveTimeout (_timeoutToken);
|
|
|
|
|
|
+ if (_timeoutToken != null) {
|
|
|
|
+ Application.MainLoop.RemoveTimeout (_timeoutToken);
|
|
|
|
+ }
|
|
base.Dispose (disposing);
|
|
base.Dispose (disposing);
|
|
}
|
|
}
|
|
|
|
|
|
@@ -81,19 +83,21 @@ namespace UICatalog {
|
|
_activityProgressBar.Fraction = 0F;
|
|
_activityProgressBar.Fraction = 0F;
|
|
_pulseProgressBar.Fraction = 0F;
|
|
_pulseProgressBar.Fraction = 0F;
|
|
|
|
|
|
- _timer = new Timer ((o) => Application.MainLoop.Invoke (() => Pulse ()), null, 0, 10);
|
|
|
|
|
|
+ _timer = new Timer ((o) => Application.MainLoop.Invoke (() => Pulse ()), null, 0, 250);
|
|
|
|
|
|
// BUGBUG: This timeout does nothing but return true, however it trigger the Application.MainLoop
|
|
// BUGBUG: This timeout does nothing but return true, however it trigger the Application.MainLoop
|
|
// to run the Action. Without this timeout, the display updates are random,
|
|
// to run the Action. Without this timeout, the display updates are random,
|
|
// or triggered by user interaction with the UI. See #155
|
|
// or triggered by user interaction with the UI. See #155
|
|
- _timeoutToken = Application.MainLoop.AddTimeout (TimeSpan.FromMilliseconds (10), loop => true);
|
|
|
|
|
|
+ //_timeoutToken = Application.MainLoop.AddTimeout (TimeSpan.FromMilliseconds (10), loop => true);
|
|
}
|
|
}
|
|
|
|
|
|
private void Stop ()
|
|
private void Stop ()
|
|
{
|
|
{
|
|
_timer?.Dispose ();
|
|
_timer?.Dispose ();
|
|
_timer = null;
|
|
_timer = null;
|
|
- Application.MainLoop.RemoveTimeout (_timeoutToken);
|
|
|
|
|
|
+ if (_timeoutToken != null) {
|
|
|
|
+ Application.MainLoop.RemoveTimeout (_timeoutToken);
|
|
|
|
+ }
|
|
|
|
|
|
_activityProgressBar.Fraction = 1F;
|
|
_activityProgressBar.Fraction = 1F;
|
|
_pulseProgressBar.Fraction = 1F;
|
|
_pulseProgressBar.Fraction = 1F;
|