private AssociationLabel CreateFellowLabel(AssociationLabelViewHelper labelViewHelper) { AssociationLabel associationLabel = new AssociationLabel(this.XCaseCanvas, labelViewHelper); Junction.XCaseCanvas.Children.Add(associationLabel); associationLabel.Text = " "; associationLabel.SnapTo(Junction.Points.Last(), false); associationLabel.UpdateLayout(); Canvas.SetZIndex(associationLabel, Canvas.GetZIndex(Junction.SourceElement) + 1); associationLabel.PSM_Association = this; return(associationLabel); }
private AssociationLabel CreateFellowLabel(AssociationLabelViewHelper labelViewHelper) { AssociationLabel associationLabel = new AssociationLabel(this.XCaseCanvas, labelViewHelper); associationLabel.Association = this.Association; Junction.XCaseCanvas.Children.Add(associationLabel); associationLabel.Text = " "; associationLabel.SnapTo(this, false); associationLabel.AssociationEnd = this.AssociationEnd; associationLabel.UpdateLayout(); Canvas.SetZIndex(associationLabel, Canvas.GetZIndex(Junction.SourceElement) + 1); associationLabel.Dropped += (() => LabelDropped(associationLabel)); return(associationLabel); }
public AssociationLabel(XCaseCanvas xCaseCanvas, AssociationLabelViewHelper labelViewHelper) : base(xCaseCanvas) { FontWeight = FontWeights.Bold; Margin = new Thickness(0); Template = (ControlTemplate)Application.Current.Resources["XCaseJunctionLabelTemplate"]; ApplyTemplate(); XCaseJunctionLabelTemplate gr = (XCaseJunctionLabelTemplate)Template.FindName("JunctionLabelGrid", this); TextBox = gr.txtText; OriginalTextBrush = Brushes.Blue; ViewHelper = labelViewHelper; FocusVisualStyle = null; this.StartBindings(TypeBindingData.EBindingSourceType.View); }