static void SetConnectorLabel(Connector connector, ModelItem connectorModelItem)
        {

            connector.SetBinding(Connector.LabelTextProperty,  new Binding()
            {
                Source = connectorModelItem,
                Path = new PropertyPath("DisplayName")
            });

            TextBlock toolTip = new TextBlock();
            toolTip.SetBinding(TextBlock.TextProperty, new Binding()
            {
                Source = connectorModelItem,
                Path = new PropertyPath("DisplayName"),
                StringFormat = TransitionNameToolTip + Environment.NewLine + SR.EditTransitionTooltip + Environment.NewLine + SR.CopyTransitionToolTip
            });

            connector.SetLabelToolTip(toolTip);
        }
 void SetConnectorLabelToolTip(Connector connector, BindingBase binding)
 {
     connector.SetBinding(Connector.LabelTextProperty, binding);
     ToolTip toolTip = new ToolTip();
     toolTip.SetBinding(UserControl.ContentProperty, binding);
     connector.SetLabelToolTip(toolTip);
 }
        void RefreshFlowSwitchLinkModelItem(ModelItem flowSwitchModelItem, Connector connector, bool isDefault)
        {
            ModelItem oldLinkModelItem = FlowchartDesigner.GetLinkModelItem(connector);

            IModelTreeItem modelTreeItem = flowSwitchModelItem as IModelTreeItem;
            IFlowSwitchLink link = GenericFlowSwitchHelper.CreateFlowSwitchLink(flowSwitchModelItem.ItemType, flowSwitchModelItem, ((IFlowSwitchLink)oldLinkModelItem.GetCurrentValue()).CaseObject, isDefault);
            ModelItem linkModelItem = new FakeModelItemImpl(modelTreeItem.ModelTreeManager, link.GetType(), link, null);
            link.ModelItem = linkModelItem;

            FlowchartDesigner.SetLinkModelItem(connector, linkModelItem);
            connector.SetBinding(Connector.LabelTextProperty, link.CreateConnectorLabelTextBinding());

            Selection currentSelection = this.Context.Items.GetValue<Selection>();
            if (currentSelection.SelectedObjects.Contains(oldLinkModelItem))
            {
                Selection.Toggle(this.Context, oldLinkModelItem);
                Selection.Select(this.Context, linkModelItem);
            }
        }