public Theme GetTheme(int id) { ((userThemesList.Parent as FrameworkElement).Parent as FrameworkElement).Visibility = Visibility.Collapsed; switch (id) { case 0: return(new Theme() { appleBrush = Brushes.OrangeRed, snakeHeadBrush = Brushes.White, snakeTailBrush = Brushes.DeepSkyBlue, backgroundBrush = Theme.BrushFromRGBA(51, 204, 51) }); case 1: return(new Theme() { appleBrush = Theme.BrushFromRGBA(104, 104, 104), snakeTailBrush = Theme.BrushFromRGBA(51, 51, 51), snakeHeadBrush = Theme.BrushFromRGBA(64, 64, 64), backgroundBrush = Theme.BrushFromRGBA(34, 34, 34) }); case 2: ((userThemesList.Parent as FrameworkElement).Parent as FrameworkElement).Visibility = Visibility.Visible; LoadUserThemes(); return((userThemesList?.SelectedItem as ListBoxItem)?.Tag as Theme ?? new Theme()); default: break; } return(new Theme()); }