示例#1
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ConnectorVM" /> class.
        /// </summary>
        public ConnectorVM()
        {
            this.ThemeStyleId = StyleId.Variant1;
            this.Constraints |= ConnectorConstraints.ThemeStyle | ConnectorConstraints.Draggable;
            this.ZIndex       = -10;
            this.Stroke       = new SolidColorBrush(new Color {
                A = 0xFF, R = 0x5B, G = 0x9B, B = 0xD5
            });
            this._mCollectionData = new ConnectorState(
                this.Stroke,
                this.DashDot,
                this.Thickness,
                this.SourceCap,
                this.TargetCap,
                this.SourceDecorator,
                this.TargetDecorator,
                this.SourceDecoratorStyle,
                this.TargetDecoratorStyle,
                this.ConnectorGeometryStyle,
                this.Decorator);

            // Work around
            this.ThemeStyleId = StyleId.Accent1 | StyleId.Subtly;
            this.Annotations  = new List <IAnnotation> {
                this._mAnnotation, this._mAnnotationHyperLink
            };
            this._mAnnotation.PropertyChanged += (s, e) =>
            {
                if (e.PropertyName == "Content")
                {
                    this.Label     = (string)this._mAnnotation.Content;
                    this.HyperLink = this._mAnnotationHyperLink.HyperLink;
                }
            };
        }
示例#2
0
 public ConnectorVM()
 {
     Stroke = new SolidColorBrush(new Color()
     {
         A = 0xFF, R = 0x5B, G = 0x9B, B = 0xD5
     });
     _mCollectionData = new ConnectorState(Stroke, DashDot, Thickness, SourceCap, TargetCap, SourceDecorator, TargetDecorator, SourceDecoratorStyle, TargetDecoratorStyle, ConnectorGeometryStyle, Decorator);
 }
示例#3
0
        public object RevertTo(object data)
        {
            if (data is ConnectorState)
            {
                var            current = GetData();
                ConnectorState toState = (ConnectorState)data;

                if (toState.ConnectorGeometryStyle != this.ConnectorGeometryStyle)
                {
                    this.ConnectorGeometryStyle = toState.ConnectorGeometryStyle;
                }

                if (toState.Decorator != this.Decorator)
                {
                    this.Decorator = toState.Decorator;
                }
                if (toState.DashDot != this.DashDot)
                {
                    this.DashDot = toState.DashDot;
                }
                if (toState.Stroke != this.Stroke)
                {
                    this.Stroke = toState.Stroke;
                }
                if (toState.Thickness != this.Thickness)
                {
                    this.Thickness = toState.Thickness;
                }
                if (toState.SourceCap != this.SourceCap)
                {
                    this.SourceCap = toState.SourceCap;
                }
                if (toState.TargetCap != TargetCap)
                {
                    this.TargetCap = toState.TargetCap;
                }
                if (toState.SourceDecoratorStyle != this.SourceDecoratorStyle)
                {
                    this.SourceDecoratorStyle = toState.SourceDecoratorStyle;
                }
                if (toState.TargetDecoratorStyle != TargetDecoratorStyle)
                {
                    this.TargetDecoratorStyle = toState.TargetDecoratorStyle;
                }
                if (toState.SourceDecorator != this.SourceDecorator)
                {
                    this.SourceDecorator = toState.SourceDecorator;
                }
                if (toState.TargetDecorator != TargetDecorator)
                {
                    this.TargetDecorator = toState.TargetDecorator;
                }
                return(current);
            }
            return(data);
        }
示例#4
0
 public ConnectorVM()
 {
     ZIndex = -10;
     Stroke = new SolidColorBrush(new Color()
     {
         A = 0xFF, R = 0x5B, G = 0x9B, B = 0xD5
     });
     _mCollectionData = new ConnectorState(Stroke, DashDot, Thickness, SourceCap, TargetCap, SourceDecorator, TargetDecorator, SourceDecoratorStyle, TargetDecoratorStyle, ConnectorGeometryStyle, Decorator);
     //Work around
     this.ThemeStyleId = Syncfusion.UI.Xaml.Diagram.Theming.StyleId.Accent1 | Syncfusion.UI.Xaml.Diagram.Theming.StyleId.Subtly;
 }