private async void ColorClick_Click(object sender, RoutedEventArgs e) { await GI.FadeOut(this); SelectedColor = (sender as Button).Background; SelectionMade = true; }
private async void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e) { if (!ProperClosed) { e.Cancel = true; RunVisualizer = false; SaveConfig("Saves\\autosave.txt"); var tasks = new List <Task>(); int Count = VisualizerStack.Count; for (int i = 0; i < Count; i++) { var task = VisualizerStack[i].PerformClose(); tasks.Add(task); } await Task.WhenAll(tasks); VisualizerStack.Clear(); await GI.FadeOut(this); while (VisualizersRunning) { await Task.Delay(100); } ProperClosed = true; Application.Current.Shutdown(); } }
public async Task PerformClose() { await GI.FadeOut(this); SenderWindow.VisualizerStack.Remove(this); SenderWindow.RefreshVisualizerCountLabel(); this.Close(); }
private async void ColorPickerCancel_Click(object sender, RoutedEventArgs e) { await GI.FadeOut(this); SelectedColor = null; SelectionMade = true; this.Close(); }