private void OnLoadingMessage(LoadingMessage message) { if (message.Loading) { ProgressBarVisibility = true; _running++; _dispatcherTimerHandle = _systemServices.StartTimer(OnTick, TimeSpan.FromSeconds(2), true); } else { _running--; } }
private void OnLoading(LoadingMessage obj) { _baconProvider.GetService<ISystemServices>().StartTimer((obj2, obj3) => { ProgressActive.IsVisible = obj.Loading; if(!obj.Loading) { ProgressActive.IsIndeterminate = true; ProgressActive.IsVisible = false; ProgressActive.Text = ""; ProgressActive.Value = 0; } else if (obj.Message != null && obj.Percentage != null) { ProgressActive.IsIndeterminate = false; ProgressActive.Text = obj.Message; ProgressActive.Value = ((double)obj.Percentage) / 100.0; } }, TimeSpan.FromMilliseconds(0), true); }