Ejemplo n.º 1
0
        /// <summary>
        /// Method will execute when AnnotationChangedCommand executed
        /// </summary>
        /// <param name="param">
        /// </param>
        private void AnnotationChangedCommandExecute(object param)
        {
            ChangeEventArgs <object, AnnotationChangedEventArgs> args =
                param as ChangeEventArgs <object, AnnotationChangedEventArgs>;
            AnnotationChangedEventArgs newvalue = args.NewValue;

            AnnotationChangedEventArgs oldvalue = args.OldValue;

            if (newvalue.AnnotationInteractionState == AnnotationInteractionState.Edited)
            {
                this.Updatebowtielayout(this.Rootnode.Type);
            }
        }
        void Element_AnnotationsChanged(object sender, AnnotationChangedEventArgs e)
        {
            if (mapReady)
            {
                RemoveAllAnnotations();
                AddAnnotations(Element?.Annotations?.ToArray());
            }

            if (e.OldAnnotations is INotifyCollectionChanged oldCollection)
            {
                oldCollection.CollectionChanged -= OnAnnotationsCollectionChanged;
            }

            if (e.NewAnnotations is INotifyCollectionChanged newCollection)
            {
                newCollection.CollectionChanged += OnAnnotationsCollectionChanged;
            }
        }