Пример #1
0
 public void Add(Model model)
 {
     models.Add(model);
     diagram.Control.Children.Add(model.Control);
     model.Control.ContainerCanvas = diagram.Control;
     model.Owner = diagram;
     Canvas.SetZIndex(model.Control, Count);
 }
Пример #2
0
 public ConnectorAdorner(ModelItem item)
     : base(item)
 {
     model = item.ContentObject;
     collection = new VisualCollection(this);
     // make thumbs
     for (int i = 0; i < model.Connectors.Length; i++)
         collection.Add(thumbs[i] = GetConnectorThumb(model.Connectors[i]));
     // do not use center currently
     thumbs[(int)ConnectorType.Center].Visibility = Visibility.Collapsed;
 }
Пример #3
0
 public void Remove(Model model)
 {
     // clean relationships
     foreach (Connector connector in model.Connectors)
         connector.Connections.ForEach(item => Remove(item));
     model.Owner = null;
     model.Control.ContainerCanvas = null;
     models.Remove(model);
     diagram.Control.Children.Remove(model.Control);
 }