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!");
            }
        }