// create new groupEditor public GroupEditor(GroupOverview groupOverview, Border tab, string name) { // Setting from profile ProfileOptimization.StartProfile("GroupEditor.Profile"); InitializeComponent(); // Setting default properties newExt = imageExt.Concat(specialImageExt).ToArray(); GroupOverview = groupOverview; Tab = tab; Group = new Group() { Name = name, ShortcutList = new List <Shortcut>(), SelectedBackgroundOption = BackgroundOption.Light, BackgroundColor = Color.FromRgb(230, 230, 230).ToString(), Opacity = 100 }; IsNew = true; // DropHandler DataContext = new ViewModel(this); // Setting default control values BtnDelete.Visibility = Visibility.Hidden; int num = int.Parse(LblWidth.Content.ToString()); int max = 1; CheckWidth(num, max); }
// editing an existing group public GroupEditor(GroupOverview groupOverview, Border tab, Group group) { // Setting from profile ProfileOptimization.StartProfile("GroupEditor.Profile"); InitializeComponent(); // Setting properties GroupOverview = groupOverview; Tab = tab; Group = group; IsNew = false; // DropHandler DataContext = new ViewModel(this); // Setting control values from loaded group InpGroupName.Text = Group.Name; ImgGroupIcon.Source = Group.LoadGroupImage(); LblWidth.Content = Group.Width.ToString(); Color groupBackgroundColor = ImageFunctions.FromString(Group.BackgroundColor); ClrCustomColor.SelectedColor = groupBackgroundColor; SldOpacity.Value = Group.Opacity; if (Group.SelectedBackgroundOption == BackgroundOption.Dark) { RadDark.IsChecked = true; } else if (Group.SelectedBackgroundOption == BackgroundOption.WindowsTheme) { RadWindowsTheme.IsChecked = true; } else if (Group.SelectedBackgroundOption == BackgroundOption.WindowsAccentColor) { RadWindowsAccentColor.IsChecked = true; } else if (Group.SelectedBackgroundOption == BackgroundOption.Custom) { RadCustom.IsChecked = true; ClrCustomColor.IsEnabled = true; } LoadShortcuts(); }