Exemple #1
0
        private void InitWPFTabControl()
        {
            try
            {
                if (ITabControlMainPanel != null)
                {
                    return;
                }

                ITabControlMainPanel = new YoungWPFTabControl.TabControl();

                ITabControlMainPanel.Name = "TabControlServerDetail";
                ITabControlMainPanel.TabStripPlacement        = Dock.Top;
                ITabControlMainPanel.TabItemMinWidth          = 150.00;
                ITabControlMainPanel.TabItemMinHeight         = 26;
                ITabControlMainPanel.TabItemMaxHeight         = 26;
                ITabControlMainPanel.VerticalContentAlignment = VerticalAlignment.Center;
                ITabControlMainPanel.AllowAddNew    = false;
                ITabControlMainPanel.Background     = Brushes.Transparent;
                ITabControlMainPanel.AddNewTabToEnd = true;
                ITabControlMainPanel.Opacity        = 0.8;

                LinearGradientBrush LLinearBrushNormalBackground = new LinearGradientBrush();
                LLinearBrushNormalBackground.StartPoint = new Point(0, 0);
                LLinearBrushNormalBackground.EndPoint   = new Point(0, 1);
                LLinearBrushNormalBackground.GradientStops.Add(new GradientStop(Color.FromRgb(252, 253, 253), 0.0));
                LLinearBrushNormalBackground.GradientStops.Add(new GradientStop(Color.FromRgb(229, 234, 245), 0.3));
                LLinearBrushNormalBackground.GradientStops.Add(new GradientStop(Color.FromRgb(207, 215, 235), 0.3));
                LLinearBrushNormalBackground.GradientStops.Add(new GradientStop(Color.FromRgb(224, 229, 245), 0.7));
                LLinearBrushNormalBackground.GradientStops.Add(new GradientStop(Color.FromRgb(236, 238, 252), 1.0));
                ITabControlMainPanel.TabItemNormalBackground = LLinearBrushNormalBackground;

                LinearGradientBrush LLinearBrushSelectedBackground = new LinearGradientBrush();
                LLinearBrushSelectedBackground.StartPoint = new Point(0, 0);
                LLinearBrushSelectedBackground.EndPoint   = new Point(0, 1);
                LLinearBrushSelectedBackground.GradientStops.Add(new GradientStop(Color.FromRgb(251, 253, 254), 0.0));
                LLinearBrushSelectedBackground.GradientStops.Add(new GradientStop(Color.FromRgb(234, 246, 251), 0.3));
                LLinearBrushSelectedBackground.GradientStops.Add(new GradientStop(Color.FromRgb(206, 231, 250), 0.3));
                LLinearBrushSelectedBackground.GradientStops.Add(new GradientStop(Color.FromRgb(185, 209, 250), 1.0));
                ITabControlMainPanel.TabItemSelectedBackground = LLinearBrushSelectedBackground;

                LinearGradientBrush LLinearBrushMouseOverBackground = new LinearGradientBrush();
                LLinearBrushNormalBackground.StartPoint = new Point(0, 0);
                LLinearBrushNormalBackground.EndPoint   = new Point(0, 1);
                LLinearBrushNormalBackground.GradientStops.Add(new GradientStop(Color.FromRgb(252, 253, 253), 0.0));
                LLinearBrushNormalBackground.GradientStops.Add(new GradientStop(Color.FromRgb(229, 234, 245), 0.3));
                LLinearBrushNormalBackground.GradientStops.Add(new GradientStop(Color.FromRgb(207, 215, 235), 0.3));
                LLinearBrushNormalBackground.GradientStops.Add(new GradientStop(Color.FromRgb(224, 229, 245), 0.7));
                LLinearBrushNormalBackground.GradientStops.Add(new GradientStop(Color.FromRgb(236, 238, 252), 1.0));
                ITabControlMainPanel.TabItemMouseOverBackground = LLinearBrushMouseOverBackground;

                ITabControlMainPanel.TabItemAdded     += LTabControlMainPanel_TabItemAdded;
                ITabControlMainPanel.SelectionChanged += LTabControlMainPanel_SelectionChanged;
                ITabControlMainPanel.TabItemClosed    += LTabControlMainPanel_TabItemClosed;

                GridTabControlObjectDetail.Children.Add(ITabControlMainPanel);
            }
            catch { }
        }
Exemple #2
0
 private void LTabControlMainPanel_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     try
     {
         YoungWPFTabControl.TabControl LTabControl = (YoungWPFTabControl.TabControl)e.Source;
         YoungWPFTabControl.TabItem    LTabItem    = (YoungWPFTabControl.TabItem)LTabControl.SelectedItem;
         LabelCurrentObjectPath.Content = LTabItem.Tag.ToString();
     }
     catch { }
 }