//internal void IsTheCurrent(bool isCurrentLayer) //{ // // IsCurrentLayer is auto-computed // RaisePropertyChanged("IsCurrentLayer"); //} internal void AddTag(string tag, Point center) { var anchoredTag = new AnchoredTag(new Layers.Components.Point(center.X, center.Y), layerModel.Link, lessonModel.GetTag(tag)); layerModel.Components.Add(anchoredTag); RaisePropertyChanged("DraggableComponents"); RaisePropertyChanged("AddDraggableComponent"); // To update the view through LayerContainer.xaml.cs }
/// <summary> /// Remove an AnchoredTag from a Layer, so we recompute the presence of this AnchoredTag on that Layer /// </summary> /// <param name="anchoredTag">The anchored tag.</param> /// <exception cref="System.NotImplementedException"></exception> internal void RemoveMe(AnchoredTag anchor) { if (anchor.Link.IsDead()) return; var nbLinksOfThatTagOnThatLayer = 0; var layer = (anchor.Link as LayerLink).Layer; foreach (var component in layer.Components) if (component.GetType() == typeof (AnchoredTag) && (component as AnchoredTag).Tag == this) nbLinksOfThatTagOnThatLayer++; if (nbLinksOfThatTagOnThatLayer == 0) ConcernedLayers.Remove(layer); }