private async void Grid_Initialized(object sender, EventArgs e) { int Count = 0; Type brushesType = typeof(Brushes); var properties = brushesType.GetProperties(System.Reflection.BindingFlags.Static | System.Reflection.BindingFlags.Public); for (int i = 0; i < ColorGrid.RowDefinitions.Count; i++) { for (int j = 0; j < ColorGrid.ColumnDefinitions.Count; j++) { Button NewColorButton = new Button(); NewColorButton.Background = (SolidColorBrush) new BrushConverter().ConvertFromString(properties[Count].Name); NewColorButton.Click += ColorClick_Click; Grid.SetRow(NewColorButton, i); Grid.SetColumn(NewColorButton, j); ColorGrid.Children.Add(NewColorButton); Count++; if (Count >= properties.Length) { i = ColorGrid.RowDefinitions.Count; break; } } } await GI.FadeIn(this); }
private async void Grid_Loaded(object sender, RoutedEventArgs e) { if (!Directory.Exists(Directory.GetCurrentDirectory() + "\\Saves")) { Directory.CreateDirectory(Directory.GetCurrentDirectory() + "\\Saves"); } SaveFileDialog.DefaultExt = ".txt"; LoadFileDialog.DefaultExt = ".txt"; SaveFileDialog.AddExtension = true; LoadFileDialog.AddExtension = true; AudioSourceCombobox.Items.Clear(); int DeviceCount = BassWasapi.BASS_WASAPI_GetDeviceCount(); for (int i = 0; i < DeviceCount; i++) { var device = BassWasapi.BASS_WASAPI_GetDeviceInfo(i); if (device.IsEnabled && device.IsLoopback) { AudioSourceCombobox.Items.Add(string.Format("{0} - {1}", i, device.name)); } } AudioSourceCombobox.SelectedIndex = 0; RefreshRateCombobox.Items.Clear(); for (int i = 0; i < 105; i += 5) { RefreshRateCombobox.Items.Add(i.ToString()); } RefreshRateCombobox.SelectedIndex = 0; if (File.Exists("Saves\\autosave.txt")) { LoadConfig("Saves\\autosave.txt"); } await GI.FadeIn(this); }
private async void Window_Loaded(object sender, RoutedEventArgs e) { await GI.FadeIn(this); }