Esempio n. 1
0
        public override void OnApplyTemplate()
        {
            base.OnApplyTemplate();

            if (Template == null)
            {
                return;
            }
            VertexLabelControl = Template.FindName("PART_vertexLabel", this) as IVertexLabelControl;

            if (VertexLabelControl != null)
            {
                if (ShowLabel)
                {
                    VertexLabelControl.Show();
                }
                else
                {
                    VertexLabelControl.Hide();
                }
                UpdateLayout();
                VertexLabelControl.UpdatePosition();
            }

            VertexConnectionPointsList = this.FindDescendantsOfType <IVertexConnectionPoint>().ToList();
            if (VertexConnectionPointsList.GroupBy(x => x.Id).Count(group => @group.Count() > 1) > 0)
            {
                throw new GX_InvalidDataException("Vertex connection points in VertexControl template must have unique Id!");
            }
        }
Esempio n. 2
0
 private void source_PositionChanged(object sender, EventArgs e)
 {
     if (ShowLabel && VertexLabelControl != null)
     {
         VertexLabelControl.UpdatePosition();
     }
     OnPositionChanged(new Point(), GetPosition());
 }
Esempio n. 3
0
 private void changeMonitor_ChangeDetected(object source, EventArgs args)
 {
     if (ShowLabel)
     {
         VertexLabelControl?.UpdatePosition();
     }
     OnPositionChanged(new Point(), GetPosition());
 }