private void frmSplash_Load(object sender, EventArgs e) { lblVersion.Text = String.Format("v.{0} - {1}", Assembly.GetEntryAssembly().GetName().Version, Assembly.GetEntryAssembly().GetCustomAttribute <AssemblyInformationalVersionAttribute>()?.InformationalVersion); this.m_timer.Tick += (o, ev) => { if (this.m_lastArgs != null) { lblProgress.Text = String.Format("{0} ({1:#0}%)", this.m_lastArgs.ProgressText, this.m_lastArgs.Progress * 100); } }; this.m_progressHandler = (o, ev) => { this.m_lastArgs = ev; }; DcApplicationContext.ProgressChanged += this.m_progressHandler; }
/// <summary> /// Progress changed for startup /// </summary> static void ApplicationContext_ProgressChanged(object sender, ApplicationProgressEventArgs e) { Application.Invoke((o, p) => { m_statusLabel.Text = String.Format("{0} ({1:0%})", e.ProgressText, e.Progress); }); }
/// <summary> /// Progress has changed /// </summary> private void OnProgressUpdated(Object sender, ApplicationProgressEventArgs e) { this.RunOnUiThread(() => this.FindViewById <TextView>(Resource.Id.txt_splash_info).Text = String.Format("{0} {1}", e.ProgressText, e.Progress > 0 ? String.Format("({0:0%})", e.Progress) : null)); }