コード例 #1
0
		public override void OnApplyTemplate()
		{
			if (MaxPointsUpDown != null)
				MaxPointsUpDown.ValueChanged -= MaxPointsUpDown_ValueChanged;
			if (BackgroundColorSelector != null)
				BackgroundColorSelector.ColorPicked -= BackgroundColorSelector_ColorPicked;
			if (RadiusUpDown != null)
				RadiusUpDown.ValueChanged -= RadiusUpDown_ValueChanged;
			if (ForegroundColorSelector != null)
				ForegroundColorSelector.ColorPicked -= ForegroundColorSelector_ColorPicked;

			base.OnApplyTemplate();

			MaxPointsUpDown = GetTemplateChild(PART_MaxPointsUpDown) as NumericUpDown;
			if (MaxPointsUpDown != null)
				MaxPointsUpDown.ValueChanged += MaxPointsUpDown_ValueChanged;

			BackgroundColorSelector = GetTemplateChild(PART_BackgroundColorSelector) as SolidColorBrushSelector;
			if (BackgroundColorSelector != null)
				BackgroundColorSelector.ColorPicked += BackgroundColorSelector_ColorPicked;

			RadiusUpDown = GetTemplateChild(PART_RadiusUpDown) as NumericUpDown;
			if (RadiusUpDown != null)
				RadiusUpDown.ValueChanged += RadiusUpDown_ValueChanged;

			ForegroundColorSelector = GetTemplateChild(PART_ForegroundColorSelector) as SolidColorBrushSelector;
			if (ForegroundColorSelector != null)
				ForegroundColorSelector.ColorPicked += ForegroundColorSelector_ColorPicked;

			bindUI();

            if (InitCompleted != null)
                InitCompleted(this, EventArgs.Empty);
		}
コード例 #2
0
        /// <summary>
        /// SelectedColorBrushProperty property changed handler.
        /// </summary>
        /// <param name="d">ColorPalette that changed its SelectedColorBrush.</param>
        /// <param name="e">Event arguments.</param>
        private static void OnSelectedColorBrushPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            SolidColorBrushSelector source = d as SolidColorBrushSelector;
            SolidColorBrush         value  = e.NewValue as SolidColorBrush;

            source.OnSelectedColorBrushPropertyChanged();
        }
コード例 #3
0
        public override void OnApplyTemplate()
        {   
            if (PointThickness != null)
                PointThickness.ThicknessValueChanged -= PointThickness_ThicknessValueChanged;

            if (SymbolBorderThickness != null)
                SymbolBorderThickness.ThicknessValueChanged -= SymbolBorderThickness_ThicknessValueChanged;

            if (OutlineColorSelector != null)
                OutlineColorSelector.ColorPicked -= OutlineColorSelector_ColorPicked;

            if (SymbolPicker != null)
            {
                SymbolPicker.CollapseDropDown();
                SymbolPicker.SymbolSelected -= SymbolPicker_SymbolSelected;
            }

            if(OpacitySlider != null)
                OpacitySlider.ValueChanged -= OpacitySlider_ValueChanged;

            if (BorderOpacitySlider != null)
                BorderOpacitySlider.ValueChanged -= BorderOpacitySlider_ValueChanged;

            base.OnApplyTemplate();

            SymbolPicker = GetTemplateChild(PART_SYMBOLPICKER) as SymbolPicker;            
            if(SymbolPicker != null)
                SymbolPicker.SymbolSelected += SymbolPicker_SymbolSelected;

            PointThickness = GetTemplateChild(PART_POINTTHICKNESS) as ThicknessUpDownControl;
            if(PointThickness != null)
                PointThickness.ThicknessValueChanged += PointThickness_ThicknessValueChanged;

            SymbolBorderThickness = GetTemplateChild(PART_SYMBOLBORDERTHICKNESS) as ThicknessUpDownControl;
            if (SymbolBorderThickness != null)
                SymbolBorderThickness.ThicknessValueChanged += SymbolBorderThickness_ThicknessValueChanged;

            OutlineColorSelector = GetTemplateChild(PART_OUTLINECOLORSELECTOR) as SolidColorBrushSelector;
            if(OutlineColorSelector != null)
                OutlineColorSelector.ColorPicked += OutlineColorSelector_ColorPicked;

            FillColorSelector = GetTemplateChild(PART_FILLCOLORSELECTOR) as SolidColorBrushSelector;
            if(FillColorSelector != null)
                FillColorSelector.ColorPicked += FillColorSelector_ColorPicked;

            OpacitySlider = GetTemplateChild(PART_OPACITYSLIDER) as Slider;
            if (OpacitySlider != null)
                OpacitySlider.ValueChanged += OpacitySlider_ValueChanged;

            BorderOpacitySlider = GetTemplateChild(PART_BORDEROPACITYSLIDER) as Slider;
            if(BorderOpacitySlider != null)
                BorderOpacitySlider.ValueChanged += BorderOpacitySlider_ValueChanged;

            bindUIToSymbol();

            if (InitCompleted != null)
                InitCompleted(this, EventArgs.Empty);
        }
コード例 #4
0
        public override void OnApplyTemplate()
        {
            if (MaxPointsUpDown != null)
            {
                MaxPointsUpDown.ValueChanged -= MaxPointsUpDown_ValueChanged;
            }
            if (BackgroundColorSelector != null)
            {
                BackgroundColorSelector.ColorPicked -= BackgroundColorSelector_ColorPicked;
            }
            if (RadiusUpDown != null)
            {
                RadiusUpDown.ValueChanged -= RadiusUpDown_ValueChanged;
            }
            if (ForegroundColorSelector != null)
            {
                ForegroundColorSelector.ColorPicked -= ForegroundColorSelector_ColorPicked;
            }

            base.OnApplyTemplate();

            MaxPointsUpDown = GetTemplateChild(PART_MaxPointsUpDown) as NumericUpDown;
            if (MaxPointsUpDown != null)
            {
                MaxPointsUpDown.ValueChanged += MaxPointsUpDown_ValueChanged;
            }

            BackgroundColorSelector = GetTemplateChild(PART_BackgroundColorSelector) as SolidColorBrushSelector;
            if (BackgroundColorSelector != null)
            {
                BackgroundColorSelector.ColorPicked += BackgroundColorSelector_ColorPicked;
            }

            RadiusUpDown = GetTemplateChild(PART_RadiusUpDown) as NumericUpDown;
            if (RadiusUpDown != null)
            {
                RadiusUpDown.ValueChanged += RadiusUpDown_ValueChanged;
            }

            ForegroundColorSelector = GetTemplateChild(PART_ForegroundColorSelector) as SolidColorBrushSelector;
            if (ForegroundColorSelector != null)
            {
                ForegroundColorSelector.ColorPicked += ForegroundColorSelector_ColorPicked;
            }

            bindUI();

            if (InitCompleted != null)
            {
                InitCompleted(this, EventArgs.Empty);
            }
        }
コード例 #5
0
        public override void OnApplyTemplate()
        {
            if (PointThickness != null)
            {
                PointThickness.ThicknessValueChanged -= PointThickness_ThicknessValueChanged;
            }

            if (SymbolBorderThickness != null)
            {
                SymbolBorderThickness.ThicknessValueChanged -= SymbolBorderThickness_ThicknessValueChanged;
            }

            if (OutlineColorSelector != null)
            {
                OutlineColorSelector.ColorPicked -= OutlineColorSelector_ColorPicked;
            }

            if (SymbolPicker != null)
            {
                SymbolPicker.CollapseDropDown();
                SymbolPicker.SymbolSelected -= SymbolPicker_SymbolSelected;
            }

            if (OpacitySlider != null)
            {
                OpacitySlider.ValueChanged -= OpacitySlider_ValueChanged;
            }

            if (BorderOpacitySlider != null)
            {
                BorderOpacitySlider.ValueChanged -= BorderOpacitySlider_ValueChanged;
            }

            base.OnApplyTemplate();

            SymbolPicker = GetTemplateChild(PART_SYMBOLPICKER) as SymbolPicker;
            if (SymbolPicker != null)
            {
                SymbolPicker.SymbolSelected += SymbolPicker_SymbolSelected;
            }

            PointThickness = GetTemplateChild(PART_POINTTHICKNESS) as ThicknessUpDownControl;
            if (PointThickness != null)
            {
                PointThickness.ThicknessValueChanged += PointThickness_ThicknessValueChanged;
            }

            SymbolBorderThickness = GetTemplateChild(PART_SYMBOLBORDERTHICKNESS) as ThicknessUpDownControl;
            if (SymbolBorderThickness != null)
            {
                SymbolBorderThickness.ThicknessValueChanged += SymbolBorderThickness_ThicknessValueChanged;
            }

            OutlineColorSelector = GetTemplateChild(PART_OUTLINECOLORSELECTOR) as SolidColorBrushSelector;
            if (OutlineColorSelector != null)
            {
                OutlineColorSelector.ColorPicked += OutlineColorSelector_ColorPicked;
            }

            FillColorSelector = GetTemplateChild(PART_FILLCOLORSELECTOR) as SolidColorBrushSelector;
            if (FillColorSelector != null)
            {
                FillColorSelector.ColorPicked += FillColorSelector_ColorPicked;
            }

            OpacitySlider = GetTemplateChild(PART_OPACITYSLIDER) as Slider;
            if (OpacitySlider != null)
            {
                OpacitySlider.ValueChanged += OpacitySlider_ValueChanged;
            }

            BorderOpacitySlider = GetTemplateChild(PART_BORDEROPACITYSLIDER) as Slider;
            if (BorderOpacitySlider != null)
            {
                BorderOpacitySlider.ValueChanged += BorderOpacitySlider_ValueChanged;
            }

            bindUIToSymbol();

            if (InitCompleted != null)
            {
                InitCompleted(this, EventArgs.Empty);
            }
        }