/// <summary> /// Erzeugt Menü für Log- bzw Error-Tabelle /// </summary> private void AddMenus() { MenuThreeOptions LogMenu = new MenuThreeOptions(3, false); LogMenu.SetOptions("Show Details about Model", "Show Details about Instance", "Start this Process again", "Images/lupe_black.png", "Images/lupe_black.png", "Images/play_black.png"); LogMenu.AdaptMenuColorToSystemStateOverview(); LogMenu.HorizontalAlignment = HorizontalAlignment.Right; LogMenu.VerticalAlignment = VerticalAlignment.Top; _attachedLogMenu = LogMenu; Grid.SetRowSpan(LogMenu, 3); Grid.SetColumn(LogMenu, 1); Grid.SetColumnSpan(LogMenu, 2); MainGrid.Children.Add(LogMenu); _attachedLogMenu.MenuOptionSelected += new RoutedEventHandler(AttachedMenu_MenuOptionSelected); LogMenu.Visibility = System.Windows.Visibility.Hidden; MenuTwoOptions ErrorMenu = new MenuTwoOptions(2, false); ErrorMenu.SetOptions("Show Possibilites to solve this error", "Guess another option...?", "Images/lupe_black.png", "Images/maybe.png"); ErrorMenu.RemoveButtonBackgroundColorAndSetTextWhite(); ErrorMenu.HorizontalAlignment = HorizontalAlignment.Right; ErrorMenu.VerticalAlignment = VerticalAlignment.Top; _attachedErrorMenu = ErrorMenu; Grid.SetRowSpan(ErrorMenu, 3); Grid.SetColumn(ErrorMenu, 1); Grid.SetColumnSpan(ErrorMenu, 2); MainGrid.Children.Add(ErrorMenu); _attachedErrorMenu.MenuOptionSelected += new RoutedEventHandler(AttachedMenu_MenuOptionSelected); ErrorMenu.Visibility = System.Windows.Visibility.Hidden; }
/// <summary> /// Erzeuge zugehöriges Menü /// </summary> /// <returns>erzeugtes Menü</returns> private Menu AddMenu() { MenuThreeOptions ModelItemMenu = new MenuThreeOptions(3, false); // Make dependent from Favourite-State ModelItemMenu.SetOptions("Start Process", "Add to Favourites", "Close this Panel", "../Images/play_black.png", "../Images/wherz_black.png", "../Images/wloeschselect.png"); ModelItemMenu.AdaptMenuColorToModelDetail(); // ModelItemMenu.MenuOptionSelected += new RoutedEventHandler(ModelItemMenuOptionSelected); ModelItemMenu.HorizontalAlignment = HorizontalAlignment.Left; ModelItemMenu.VerticalAlignment = VerticalAlignment.Top; ModelItemMenu.Margin = new Thickness(390 - ModelItemMenu.MenuButtonWidth, 0, 0, 0); _attachedMenu = ModelItemMenu; Grid.SetRowSpan(ModelItemMenu, 2); Grid.SetColumnSpan(ModelItemMenu, 3); MainGrid.Children.Add(ModelItemMenu); _attachedMenu.MenuOptionSelected += new RoutedEventHandler(AttachedMenu_MenuOptionSelected); ((MenuThreeOptions)_attachedMenu).OptionWasChosenEvent += new MenuThreeOptions.SendChosenOptionEventHandler(ModelItem_OptionWasChosenEvent); return(ModelItemMenu); }
/// <summary> /// Schaltet Inhalt um, je nach gewähltem Tab. /// </summary> /// <param name="newCategory"></param> private void SwitchCategory(int newCategory) { if (previewCategory == -1) { return; } _currentListBox.SelectedIndex = -1; switch (_currentCategory) { case 0: Cat0ListBox.Visibility = System.Windows.Visibility.Hidden; Category0Rect.Fill = new SolidColorBrush((Color)FindResource("Category0ColorFadeNEW")); CreateReduceStoryBoard(Category0Rect, Category0Text, Category0Image); break; case 1: Cat1ListBox.Visibility = System.Windows.Visibility.Hidden; Category1Rect.Fill = new SolidColorBrush((Color)FindResource("Category1ColorFadeNEW")); CreateReduceStoryBoard(Category1Rect, Category1Text, Category1Image); break; case 2: Cat2ListBox.Visibility = System.Windows.Visibility.Hidden; Category2Rect.Fill = new SolidColorBrush((Color)FindResource("Category2ColorFadeNEW")); CreateReduceStoryBoard(Category2Rect, Category2Text, Category2Image); break; case 3: Cat3ListBox.Visibility = System.Windows.Visibility.Hidden; Category3Rect.Fill = new SolidColorBrush((Color)FindResource("Category3ColorFadeNEW")); CreateReduceStoryBoard(Category3Rect, Category3Text, Category3Image); break; case 4: Cat4ListBox.Visibility = System.Windows.Visibility.Hidden; Category4Rect.Fill = new SolidColorBrush((Color)FindResource("Category4ColorFadeNEW")); CreateReduceStoryBoard(Category4Rect, Category4Text, Category4Image); break; } // Create a linear gradient brush with 2 stops LinearGradientBrush linGB = new LinearGradientBrush(); linGB.StartPoint = new Point(0.5, 0); linGB.EndPoint = new Point(0.5, 1); // Create and add Gradient stops GradientStop firstGS = new GradientStop(); firstGS.Offset = 0.0; linGB.GradientStops.Add(firstGS); GradientStop secondGS = new GradientStop(); secondGS.Offset = 0.9; linGB.GradientStops.Add(secondGS); // Set Fill property of rectangle BackgroundRectangleHeader.Fill = linGB; firstGS.Color = (Color)FindResource("Category" + newCategory + "ColorStrongNEW"); secondGS.Color = (Color)FindResource("Category" + newCategory + "ColorFadeNEW"); BackgroundRectangleListBox.Fill = new SolidColorBrush((Color)FindResource("Category" + newCategory + "ColorFadeNEW")); //Border.Stroke = new SolidColorBrush((Color)FindResource("Category" + newCategory + "ColorStrongNEW")); SurfaceListBox newListBox = Cat0ListBox; switch (newCategory) { case 0: Cat0ListBox.Visibility = System.Windows.Visibility.Visible; // Category0Line.Visibility = System.Windows.Visibility.Hidden; CreateExpandStoryBoard(Category0Rect, Category0Text, Category0Image); break; case 1: Cat1ListBox.Visibility = System.Windows.Visibility.Visible; // Category1Line.Visibility = System.Windows.Visibility.Hidden; CreateExpandStoryBoard(Category1Rect, Category1Text, Category1Image); newListBox = Cat1ListBox; break; case 2: Cat2ListBox.Visibility = System.Windows.Visibility.Visible; // Category2Line.Visibility = System.Windows.Visibility.Hidden; CreateExpandStoryBoard(Category2Rect, Category2Text, Category2Image); newListBox = Cat2ListBox; break; case 3: Cat3ListBox.Visibility = System.Windows.Visibility.Visible; // Category3Line.Visibility = System.Windows.Visibility.Hidden; CreateExpandStoryBoard(Category3Rect, Category3Text, Category3Image); newListBox = Cat3ListBox; break; case 4: Cat4ListBox.Visibility = System.Windows.Visibility.Visible; // Category4Line.Visibility = System.Windows.Visibility.Hidden; CreateExpandStoryBoard(Category4Rect, Category4Text, Category4Image); newListBox = Cat4ListBox; break; } if (newCategory == 0) { _attachedMenu.SetOptions(_attachedMenu.OptionTexts[0].Text, _attachedMenu.OptionTexts[1].Text, "Remove from Favourites", "../Images/play_black.png", "../Images/lupe_black.png", "../Images/wherz_black_crossed.png"); } else { _attachedMenu.SetOptions(_attachedMenu.OptionTexts[0].Text, _attachedMenu.OptionTexts[1].Text, "Add to Favourites", "../Images/play_black.png", "../Images/lupe_black.png", "../Images/wherz_black_crossed2.png"); } _currentCategory = newCategory; previewCategory = -1; if (_currentListBox.Height != newListBox.Height) { ResizeListBox(newListBox); } _currentListBox = newListBox; }