Пример #1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (Template != null)
            {
                _linePathObject = Template.FindName("PART_edgePath", this) as Path;
                if (_linePathObject == null)
                {
                    throw new GX_ObjectNotFoundException("EdgeControl Template -> Edge template must contain 'PART_edgePath' Path object to draw route points!");
                }
                _linePathObject.Data = _linegeometry;
                _arrowPathObject     = Template.FindName("PART_edgeArrowPath", this) as Path;
                if (_arrowPathObject == null)
                {
                    Debug.WriteLine("EdgeControl Template -> Edge template have no 'PART_edgeArrowPath' Path object to draw!");
                }
                else
                {
                    _arrowPathObject.Data = _arrowgeometry;
                }
                _edgeLabelControl = Template.FindName("PART_edgeLabel", this) as EdgeLabelControl;
                //if (EdgeLabelControl == null) Debug.WriteLine("EdgeControl Template -> Edge template have no 'PART_edgeLabel' object to draw!");
                UpdateEdge();
            }
        }
Пример #2
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (Template != null)
            {
                _linePathObject = Template.FindName("PART_edgePath", this) as Path;
                if (_linePathObject == null) throw new GX_ObjectNotFoundException("EdgeControl Template -> Edge template must contain 'PART_edgePath' Path object to draw route points!");
                _linePathObject.Data = _linegeometry;
                _arrowPathObject = Template.FindName("PART_edgeArrowPath", this) as Path;
                if (_arrowPathObject == null) Debug.WriteLine("EdgeControl Template -> Edge template have no 'PART_edgeArrowPath' Path object to draw!");
                else
                {
                    _arrowPathObject.Data = _arrowgeometry;
                }
                _edgeLabelControl = Template.FindName("PART_edgeLabel", this) as EdgeLabelControl;
                //if (EdgeLabelControl == null) Debug.WriteLine("EdgeControl Template -> Edge template have no 'PART_edgeLabel' object to draw!");
                UpdateEdge();
            }
        }