コード例 #1
0
        //Vertical ruler and Horizontal ruler customization properties
        private void ColorPickerPalette_ColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            Syncfusion.Windows.Tools.Controls.ColorPickerPalette cpp = d as Syncfusion.Windows.Tools.Controls.ColorPickerPalette;
            switch (cpp.Name)
            {
            case "BGround":
                horizontalRuler.Background = new SolidColorBrush(BGround.Color);
                break;

            case "MajorLineStroke":
                horizontalRuler.MajorLinesStroke = new SolidColorBrush(MajorLineStroke.Color);
                break;

            case "MinorLineStroke":
                horizontalRuler.MinorLinesStroke = new SolidColorBrush(MinorLineStroke.Color);
                break;

            case "LabelFontColor":
                horizontalRuler.LabelFontColor = new SolidColorBrush(LabelFontColor.Color);
                break;

            case "MarkerBrush":
                horizontalRuler.MarkerBrush = new SolidColorBrush(MarkerBrush.Color);
                break;

            case "VBGround":
                verticalRuler.Background = new SolidColorBrush(VBGround.Color);
                break;

            case "VMajorLineStroke":
                verticalRuler.MajorLinesStroke = new SolidColorBrush(VMajorLineStroke.Color);
                break;

            case "VMinorLineStroke":
                verticalRuler.MinorLinesStroke = new SolidColorBrush(VMinorLineStroke.Color);
                break;

            case "VLabelFontColor":
                verticalRuler.LabelFontColor = new SolidColorBrush(VLabelFontColor.Color);
                break;

            case "VMarkerBrush":
                verticalRuler.MarkerBrush = new SolidColorBrush(VMarkerBrush.Color);
                break;
            }
        }
コード例 #2
0
 //Fill and Stroke Color changed
 private void fill_ColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     Syncfusion.Windows.Tools.Controls.ColorPickerPalette cpp = d as Syncfusion.Windows.Tools.Controls.ColorPickerPalette;
     if (diagramView.SelectionList.Count > 0)
     {
         if (head.IsChecked == true)
         {
             foreach (object o in diagramView.SelectionList)
             {
                 if (o is LineConnector)
                 {
                     ConnectionPort cp = (o as LineConnector).ConnectionHeadPort;
                     if (cpp.Name == "fill")
                     {
                         UpdateAppearance(cp, new SolidColorBrush(fill.Color), true);
                     }
                     else if (cpp.Name == "stroke")
                     {
                         UpdateAppearance(cp, new SolidColorBrush(stroke.Color), false);
                     }
                 }
             }
         }
         else if (tail.IsChecked == true)
         {
             foreach (object o in diagramView.SelectionList)
             {
                 if (o is LineConnector)
                 {
                     ConnectionPort cp = (o as LineConnector).ConnectionTailPort;
                     if (cpp.Name == "fill")
                     {
                         UpdateAppearance(cp, new SolidColorBrush(fill.Color), true);
                     }
                     else if (cpp.Name == "stroke")
                     {
                         UpdateAppearance(cp, new SolidColorBrush(stroke.Color), false);
                     }
                 }
             }
         }
     }
 }
コード例 #3
0
 /// <summary>
 /// HeadDecoratorStyle and TailDecoratorStyle properties are used for customzing the appoerance of the DecoratorShpae of the LineConnector
 /// </summary>
 /// <param name="d"></param>
 /// <param name="e"></param>
 /// For Changin the Fill and Stroke of the LienCOnnector
 private void fill_ColorChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
 {
     Syncfusion.Windows.Tools.Controls.ColorPickerPalette cpp = d as Syncfusion.Windows.Tools.Controls.ColorPickerPalette;
     if (diagramView.SelectionList.Count > 0)
     {
         foreach (object o in diagramView.SelectionList)
         {
             if (o is LineConnector)
             {
                 LineConnector selectedline = (o as LineConnector);
                 if (headselect)
                 {
                     if (cpp.Name == "fill")
                     {
                         selectedline.HeadDecoratorStyle.Fill = new SolidColorBrush(fill.Color);
                     }
                     else
                     {
                         selectedline.HeadDecoratorStyle.Stroke = new SolidColorBrush(stroke.Color);
                     }
                 }
                 else
                 {
                     if (cpp.Name == "fill")
                     {
                         selectedline.TailDecoratorStyle.Fill = new SolidColorBrush(fill.Color);
                     }
                     else
                     {
                         selectedline.TailDecoratorStyle.Stroke = new SolidColorBrush(stroke.Color);
                     }
                 }
             }
         }
     }
 }