Пример #1
0
        private static void HandleColorListPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PartBaseStateLED me = d as PartBaseStateLED;

            if (me != null)
            {
                string selectedColorsListString = (string)e.NewValue;

                if (me.colors.colorListString != selectedColorsListString)
                {
                    me.colors = new Colors(selectedColorsListString);
                    me.Update();
                }
            }
        }
Пример #2
0
        private static void HandleBorderWidthPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PartBaseStateLED me = d as PartBaseStateLED;

            if (me != null)
            {
                double selectedWidth = (double)e.NewValue;

                if (me.lastBorderWidth != selectedWidth)
                {
                    me.lastBorderWidth = selectedWidth;
                    me.Update();
                }
            }
        }
Пример #3
0
        private static void HandleBorderThicknessPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            PartBaseStateLED me = d as PartBaseStateLED;

            if (me != null)
            {
                Thickness selectedThickness = (Thickness)e.NewValue;
                double    selectedWidth     = (selectedThickness.Bottom + selectedThickness.Top + selectedThickness.Left + selectedThickness.Right) * 0.25;

                if (me.lastBorderWidth != selectedWidth)
                {
                    me.lastBorderWidth = selectedWidth;
                    me.Update();
                }
            }
        }