private void OnElementAdded(ElementAddedEventArgs args)
        {
            SpecificDependenciesItemViewModel vm = this.CreateSpecificViewModel(this.ViewModelStore, args.ModelElement);

            this.itemViewModels.Add(vm);

            UpdateIndices();
        }
        /// <summary>
        /// Initializes the specific vms.
        /// </summary>
        protected virtual void InitSpecificVMs()
        {
            ReadOnlyCollection <ModelElement> col = this.Store.ElementDirectory.FindElements(this.ModelElementType);

            for (int i = 0; i < col.Count; i++)
            {
                SpecificDependenciesItemViewModel vm = this.CreateSpecificViewModel(this.ViewModelStore, col[i]);
                vm.Index = i + 1;
                this.itemViewModels.Add(vm);
            }

            if (this.SpecificItemVMs.Count > 0)
            {
                this.SelectedSpecificItemVM = this.SpecificItemVMs[0];
            }
        }
        private void OnElementDeleted(ElementDeletedEventArgs args)
        {
            if (this.SelectedSpecificItemVM != null)
            {
                if (this.SelectedSpecificItemVM.Element.Id == args.ElementId)
                {
                    this.SelectedSpecificItemVM = null;
                }
            }

            for (int i = SpecificItemVMs.Count - 1; i >= 0; i--)
            {
                if (SpecificItemVMs[i].Element.Id == args.ElementId)
                {
                    SpecificItemVMs[i].Dispose();
                    SpecificItemVMs.RemoveAt(i);
                }
            }

            UpdateIndices();
        }
        private void OnElementDeleted(ElementDeletedEventArgs args)
        {
            if (this.SelectedSpecificItemVM != null)
                if (this.SelectedSpecificItemVM.Element.Id == args.ElementId)
                    this.SelectedSpecificItemVM = null;

            for (int i = SpecificItemVMs.Count - 1; i >= 0; i--)
            {
                if (SpecificItemVMs[i].Element.Id == args.ElementId)
                {
                    SpecificItemVMs[i].Dispose();
                    SpecificItemVMs.RemoveAt(i);
                }
            }

            UpdateIndices();
        }
        /// <summary>
        /// Initializes the specific vms.
        /// </summary>
        protected virtual void InitSpecificVMs()
        {
            ReadOnlyCollection<ModelElement> col = this.Store.ElementDirectory.FindElements(this.ModelElementType);
            for (int i = 0; i < col.Count; i++)
            {
                SpecificDependenciesItemViewModel vm = this.CreateSpecificViewModel(this.ViewModelStore, col[i]);
                vm.Index = i + 1;
                this.itemViewModels.Add(vm);
            }

            if (this.SpecificItemVMs.Count > 0)
                this.SelectedSpecificItemVM = this.SpecificItemVMs[0];
        }