using System.Windows; using NonaBGS.EDDB; namespace NonaBGS { /// /// Interaction logic for Window1.xaml /// public partial class ProgressDialog : Window { private readonly API api = null; public ProgressDialog(API api) { InitializeComponent(); this.api = api; this.api.DatabaseUpdateFinished += Api_DatabaseUpdateFinished; this.api.DatabaseUpdateProgress += Api_DatabaseUpdateProgress; } private void Api_DatabaseUpdateProgress() { progress.Value = (progress.Value + 1) % 100; } private void Api_DatabaseUpdateFinished() { Close(); } public void StartDownload() { api.Download(true); } } }