Esempio n. 1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (_colorShadingCanvas != null)
            {
                _colorShadingCanvas.MouseLeftButtonDown -= ColorShadingCanvas_MouseLeftButtonDown;
                _colorShadingCanvas.MouseLeftButtonUp   -= ColorShadingCanvas_MouseLeftButtonUp;
                _colorShadingCanvas.MouseMove           -= ColorShadingCanvas_MouseMove;
                _colorShadingCanvas.SizeChanged         -= ColorShadingCanvas_SizeChanged;
            }

            _colorShadingCanvas = GetTemplateChild(PART_ColorShadingCanvas) as Canvas;

            if (_colorShadingCanvas != null)
            {
                _colorShadingCanvas.MouseLeftButtonDown += ColorShadingCanvas_MouseLeftButtonDown;
                _colorShadingCanvas.MouseLeftButtonUp   += ColorShadingCanvas_MouseLeftButtonUp;
                _colorShadingCanvas.MouseMove           += ColorShadingCanvas_MouseMove;
                _colorShadingCanvas.SizeChanged         += ColorShadingCanvas_SizeChanged;
            }

            _colorShadeSelector = GetTemplateChild(PART_ColorShadeSelector) as Canvas;

            if (_colorShadeSelector != null)
            {
                _colorShadeSelector.RenderTransform = _colorShadeSelectorTransform;
            }

            if (_spectrumSlider != null)
            {
                _spectrumSlider.ValueChanged -= SpectrumSlider_ValueChanged;
            }

            _spectrumSlider = GetTemplateChild(PART_SpectrumSlider) as ColorSpectrumSlider;

            if (_spectrumSlider != null)
            {
                _spectrumSlider.ValueChanged += SpectrumSlider_ValueChanged;
            }

            if (_hexadecimalTextBox != null)
            {
                _hexadecimalTextBox.LostFocus -= new RoutedEventHandler(HexadecimalTextBox_LostFocus);
            }

            _hexadecimalTextBox = GetTemplateChild(PART_HexadecimalTextBox) as TextBox;

            if (_hexadecimalTextBox != null)
            {
                _hexadecimalTextBox.LostFocus += new RoutedEventHandler(HexadecimalTextBox_LostFocus);
            }

            UpdateRGBValues(SelectedColor);
            UpdateColorShadeSelectorPosition(SelectedColor);

            // When changing theme, HexadecimalString needs to be set since it is not binded.
            SetHexadecimalTextBoxTextProperty(GetFormatedColorString(SelectedColor));
        }
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (_colorShadingCanvas != null)
            {
                _colorShadingCanvas.MouseLeftButtonDown -= ColorShadingCanvas_MouseLeftButtonDown;
                _colorShadingCanvas.MouseLeftButtonUp   -= ColorShadingCanvas_MouseLeftButtonUp;
                _colorShadingCanvas.MouseMove           -= ColorShadingCanvas_MouseMove;
                _colorShadingCanvas.SizeChanged         -= ColorShadingCanvas_SizeChanged;
            }

            _colorShadingCanvas = GetTemplateChild("PART_ColorShadingCanvas") as Canvas;

            if (_colorShadingCanvas != null)
            {
                _colorShadingCanvas.MouseLeftButtonDown += ColorShadingCanvas_MouseLeftButtonDown;
                _colorShadingCanvas.MouseLeftButtonUp   += ColorShadingCanvas_MouseLeftButtonUp;
                _colorShadingCanvas.MouseMove           += ColorShadingCanvas_MouseMove;
                _colorShadingCanvas.SizeChanged         += ColorShadingCanvas_SizeChanged;
            }

            _colorShadeSelector = GetTemplateChild("PART_ColorShadeSelector") as Canvas;

            if (_colorShadeSelector != null)
            {
                _colorShadeSelector.RenderTransform = _colorShadeSelectorTransform;
            }

            if (_spectrumSlider != null)
            {
                _spectrumSlider.ValueChanged -= SpectrumSlider_ValueChanged;
            }

            _spectrumSlider = GetTemplateChild("PART_SpectrumSlider") as ColorSpectrumSlider;

            if (_spectrumSlider != null)
            {
                _spectrumSlider.ValueChanged += SpectrumSlider_ValueChanged;
            }

            UpdateRGBValues(SelectedColor);
            UpdateColorShadeSelectorPosition(SelectedColor);
        }
Esempio n. 3
0
        void System.Windows.Markup.IComponentConnector.Connect(int connectionId, object target)
        {
            switch (connectionId)
            {
            case 1:
                this.mainWindow = ((WpfApp1.MainWindow)(target));
                return;

            case 2:
                this.mainGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 3:
                this.BackgroundImage = ((System.Windows.Controls.Image)(target));
                return;

            case 4:
                this.functionGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 5:
                this.screenViewToggle = ((System.Windows.Controls.Primitives.ToggleButton)(target));

#line 86 "..\..\MainWindow.xaml"
                this.screenViewToggle.Click += new System.Windows.RoutedEventHandler(this.screenViewToggle_Click);

#line default
#line hidden
                return;

            case 6:
                this.browseBtn = ((System.Windows.Controls.Button)(target));
                return;

            case 7:
                this.changeColorBtn = ((System.Windows.Controls.Button)(target));
                return;

            case 8:
                this.colorSpectrumSlider = ((Xceed.Wpf.Toolkit.ColorSpectrumSlider)(target));
                return;

            case 9:
                this.colorPicker = ((Xceed.Wpf.Toolkit.ColorPicker)(target));
                return;

            case 10:
                this.colorName = ((System.Windows.Controls.TextBlock)(target));
                return;

            case 11:
                this.dragCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 12:
                this.dragBtn1 = ((System.Windows.Controls.Button)(target));
                return;

            case 13:
                this.dragBtn2 = ((System.Windows.Controls.Button)(target));
                return;

            case 14:
                this.dragBtn3 = ((System.Windows.Controls.Button)(target));
                return;

            case 15:
                this.freeDragBtn = ((System.Windows.Controls.Button)(target));
                return;

            case 16:
                this.colorRect = ((System.Windows.Shapes.Rectangle)(target));
                return;

            case 17:
                this.drapDropCanvas = ((System.Windows.Controls.Canvas)(target));
                return;

            case 18:
                this.fbIcon = ((System.Windows.Controls.ContentControl)(target));
                return;

            case 19:
                this.avatarIcon = ((System.Windows.Controls.ContentControl)(target));
                return;

            case 20:
                this.pictureBox1 = ((System.Windows.Controls.ContentControl)(target));
                return;

            case 21:
                this.image1 = ((System.Windows.Controls.Image)(target));
                return;

            case 22:
                this.screenImageBox = ((System.Windows.Controls.ContentControl)(target));
                return;

            case 23:
                this.screenImage = ((System.Windows.Controls.Image)(target));
                return;

            case 24:
                this.scrollViewer = ((System.Windows.Controls.ScrollViewer)(target));
                return;

            case 25:
                this.scrollViewerGrid = ((System.Windows.Controls.Grid)(target));
                return;

            case 26:
                this.viewportControl = ((System.Windows.Controls.ItemsControl)(target));
                return;

            case 27:
                this.sleepButton = ((System.Windows.Controls.Button)(target));

#line 180 "..\..\MainWindow.xaml"
                this.sleepButton.Click += new System.Windows.RoutedEventHandler(this.sleepButton_Click);

#line default
#line hidden
                return;

            case 28:
                this.shutdownButton = ((System.Windows.Controls.Button)(target));

#line 181 "..\..\MainWindow.xaml"
                this.shutdownButton.Click += new System.Windows.RoutedEventHandler(this.shutdownButton_Click);

#line default
#line hidden
                return;

            case 29:
                this.restartButton = ((System.Windows.Controls.Button)(target));

#line 182 "..\..\MainWindow.xaml"
                this.restartButton.Click += new System.Windows.RoutedEventHandler(this.restartButton_Click);

#line default
#line hidden
                return;

            case 30:
                this.logoffButton = ((System.Windows.Controls.Button)(target));

#line 183 "..\..\MainWindow.xaml"
                this.logoffButton.Click += new System.Windows.RoutedEventHandler(this.logoffButton_Click);

#line default
#line hidden
                return;

            case 31:
                this.batteryLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 32:
                this.browseApplication = ((System.Windows.Controls.Button)(target));

#line 185 "..\..\MainWindow.xaml"
                this.browseApplication.Click += new System.Windows.RoutedEventHandler(this.browseApplication_Click);

#line default
#line hidden
                return;

            case 33:
                this.applicationPathTextBox = ((System.Windows.Controls.TextBox)(target));
                return;

            case 34:
                this.launchApplicationButton = ((System.Windows.Controls.Button)(target));

#line 187 "..\..\MainWindow.xaml"
                this.launchApplicationButton.Click += new System.Windows.RoutedEventHandler(this.launchApplicationButton_Click);

#line default
#line hidden
                return;

            case 35:
                this.pcPerformanceLabel = ((System.Windows.Controls.Label)(target));
                return;

            case 36:
                this.leftBatteryIndicator = ((System.Windows.Controls.Image)(target));
                return;

            case 37:
                this.rightBatteryIndicator = ((System.Windows.Controls.Image)(target));
                return;

            case 38:
                this.leftBatteryPercentage = ((System.Windows.Controls.Label)(target));
                return;

            case 39:
                this.rightBatteryPercentage = ((System.Windows.Controls.Label)(target));
                return;

            case 40:
                this.plot1 = ((OxyPlot.Wpf.Plot)(target));
                return;
            }
            this._contentLoaded = true;
        }
Esempio n. 4
0
    public override void OnApplyTemplate()
    {
      base.OnApplyTemplate();

      if( _colorShadingCanvas != null )
      {
        _colorShadingCanvas.MouseLeftButtonDown -= ColorShadingCanvas_MouseLeftButtonDown;
        _colorShadingCanvas.MouseLeftButtonUp -= ColorShadingCanvas_MouseLeftButtonUp;
        _colorShadingCanvas.MouseMove -= ColorShadingCanvas_MouseMove;
        _colorShadingCanvas.SizeChanged -= ColorShadingCanvas_SizeChanged;
      }

      _colorShadingCanvas = GetTemplateChild( PART_ColorShadingCanvas ) as Canvas;

      if( _colorShadingCanvas != null )
      {
        _colorShadingCanvas.MouseLeftButtonDown += ColorShadingCanvas_MouseLeftButtonDown;
        _colorShadingCanvas.MouseLeftButtonUp += ColorShadingCanvas_MouseLeftButtonUp;
        _colorShadingCanvas.MouseMove += ColorShadingCanvas_MouseMove;
        _colorShadingCanvas.SizeChanged += ColorShadingCanvas_SizeChanged;
      }

      _colorShadeSelector = GetTemplateChild( PART_ColorShadeSelector ) as Canvas;

      if( _colorShadeSelector != null )
        _colorShadeSelector.RenderTransform = _colorShadeSelectorTransform;

      if( _spectrumSlider != null )
        _spectrumSlider.ValueChanged -= SpectrumSlider_ValueChanged;

      _spectrumSlider = GetTemplateChild( PART_SpectrumSlider ) as ColorSpectrumSlider;

      if( _spectrumSlider != null )
        _spectrumSlider.ValueChanged += SpectrumSlider_ValueChanged;

      if( _hexadecimalTextBox != null )
        _hexadecimalTextBox.LostFocus -= new RoutedEventHandler( HexadecimalTextBox_LostFocus );

      _hexadecimalTextBox = GetTemplateChild( PART_HexadecimalTextBox ) as TextBox;

      if( _hexadecimalTextBox != null )
        _hexadecimalTextBox.LostFocus += new RoutedEventHandler( HexadecimalTextBox_LostFocus );

      UpdateRGBValues( SelectedColor );
      UpdateColorShadeSelectorPosition( SelectedColor );

      // When changing theme, HexadecimalString needs to be set since it is not binded.
      SetHexadecimalTextBoxTextProperty( GetFormatedColorString( SelectedColor ) );
    }
Esempio n. 5
0
    public override void OnApplyTemplate()
    {
      base.OnApplyTemplate();

      if( _colorShadingCanvas != null )
      {
        _colorShadingCanvas.MouseLeftButtonDown -= ColorShadingCanvas_MouseLeftButtonDown;
        _colorShadingCanvas.MouseLeftButtonUp -= ColorShadingCanvas_MouseLeftButtonUp;
        _colorShadingCanvas.MouseMove -= ColorShadingCanvas_MouseMove;
        _colorShadingCanvas.SizeChanged -= ColorShadingCanvas_SizeChanged;
      }

      _colorShadingCanvas = GetTemplateChild( "PART_ColorShadingCanvas" ) as Canvas;

      if( _colorShadingCanvas != null )
      {
        _colorShadingCanvas.MouseLeftButtonDown += ColorShadingCanvas_MouseLeftButtonDown;
        _colorShadingCanvas.MouseLeftButtonUp += ColorShadingCanvas_MouseLeftButtonUp;
        _colorShadingCanvas.MouseMove += ColorShadingCanvas_MouseMove;
        _colorShadingCanvas.SizeChanged += ColorShadingCanvas_SizeChanged;
      }

      _colorShadeSelector = GetTemplateChild( "PART_ColorShadeSelector" ) as Canvas;

      if( _colorShadeSelector != null )
        _colorShadeSelector.RenderTransform = _colorShadeSelectorTransform;

      if( _spectrumSlider != null )
        _spectrumSlider.ValueChanged -= SpectrumSlider_ValueChanged;

      _spectrumSlider = GetTemplateChild( "PART_SpectrumSlider" ) as ColorSpectrumSlider;

      if( _spectrumSlider != null )
        _spectrumSlider.ValueChanged += SpectrumSlider_ValueChanged;

      UpdateRGBValues( SelectedColor );
      UpdateColorShadeSelectorPosition( SelectedColor );
    }