using System.Windows; namespace AIPractice.LabellerServer.WPF { /// /// Interaction logic for UpdateDatabaseWindow.xaml /// public partial class UpdateDatabaseWindow : Window { public double Progress { get => ProgressBar.Value; set => ProgressBar.Value = value; } public UpdateDatabaseWindow(bool showProgress = true) { InitializeComponent(); if (!showProgress) { UpdateInfo.Visibility = Visibility.Collapsed; ProgressBar.Visibility = Visibility.Collapsed; WaitingBox.Visibility = Visibility.Visible; Waiting.StartWaitingSpinner(); } else { UpdateInfo.Visibility = Visibility.Visible; ProgressBar.Visibility = Visibility.Visible; WaitingBox.Visibility = Visibility.Collapsed; } } public void SetUpdatedCount(int count, int total) { UpdateInfo.Text = $"更新中...{(int) Progress}%, 已更新数目:{count}, 总计:{total}"; } } }