private async void Jvedio_BaseWindow_ContentRendered(object sender, EventArgs e) { vieModel = new VieModel_Batch(); this.DataContext = vieModel; await ResetTask(); //WaitingPanel.Visibility = Visibility.Visible; }
public WindowBatch() { InitializeComponent(); var stackPanels = MainGrid.Children.OfType <StackPanel>().ToList(); foreach (var item in stackPanels) { item.Visibility = Visibility.Collapsed; } var wrapPanels = SettingsGrid.Children.OfType <StackPanel>().ToList(); foreach (var item in wrapPanels) { item.Visibility = Visibility.Collapsed; } var RadioButtons = SideStackPanel.Children.OfType <RadioButton>().ToList(); stackPanels[Properties.Settings.Default.BatchIndex].Visibility = Visibility.Visible; wrapPanels[Properties.Settings.Default.BatchIndex].Visibility = Visibility.Visible; RadioButtons[Properties.Settings.Default.BatchIndex].IsChecked = true; if (Properties.Settings.Default.BatchIndex == 2 || Properties.Settings.Default.BatchIndex == 0) { FirsrProgressBar.Visibility = Visibility.Visible; } else { FirsrProgressBar.Visibility = Visibility.Collapsed; } vieModel = new VieModel_Batch(); this.DataContext = vieModel; cts = new CancellationTokenSource(); cts.Token.Register(() => { HandyControl.Controls.Growl.Info("取消当前任务!", "BatchGrowl"); }); ct = cts.Token; ResetTask(); }