/// <summary>
        /// Navigates forward.
        /// </summary>
        public void NavigateForward()
        {
            if (currentHistoryIndex < currentHistory.Count && currentHistoryIndex >= 0)
            {
                // verify that none of the elements are in deleted state
                for (int i = currentHistoryIndex + 1; i < currentHistory.Count; i++)
                {
                    bool isDeleted = false;
                    SelectedItemsCollection col = currentHistory[i];
                    foreach (ModelElement m in col)
                        if (m.IsDeleted || m.IsDeleting)
                        {
                            isDeleted = true;
                            break;
                        }

                    if (!isDeleted)
                    {
                        SelectionChangedEventArgs args = new SelectionChangedEventArgs(null, col);
                        args.UserData = NavigationManagerIdentifier;
                        this.viewModelStore.EventManager.GetEvent<SelectionChangedEvent>().Publish(args);

                        currentHistoryIndex++;

                        return;
                    }
                }
            }
        }
        /// <summary>
        /// Callback from SelectionChangedEvent.
        /// </summary>
        /// <param name="eventArgs">SelectionChangedEventArgs.</param>
        private void ReactOnViewSelection(SelectionChangedEventArgs eventArgs)
        {
            this.selectedModelElement = null;

            if (eventArgs.SelectedItems != null)
                if (eventArgs.SelectedItems.Count == 1)
                    this.selectedModelElement = eventArgs.SelectedItems[0] as DomainModelElement;
        }
        /// <summary>
        /// Callback from SelectionChangedEvent.
        /// </summary>
        /// <param name="eventArgs">eventArgs.</param>
        protected override void ReactOnViewSelection(SelectionChangedEventArgs eventArgs)
        {
            this.selectedItemsCollection = eventArgs.SelectedItems;
            this.SelectedItemViewModel = null;
            

            if (this.IsInitialized && this.IsDockingPaneVisible)
                Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.Threading.DispatcherExtensions.InvokeAsynchronouslyInBackground(
                    System.Windows.Threading.Dispatcher.CurrentDispatcher, new Action(UpdateVM));
        }
        /// <summary>
        /// Callback from SelectionChangedEvent.
        /// </summary>
        /// <param name="eventArgs">SelectionChangedEventArgs.</param>
        private void ReactOnViewSelection(SelectionChangedEventArgs eventArgs)
        {
            if (eventArgs.UserData != null)
                if (eventArgs.UserData as string == NavigationManagerIdentifier)
                    return;

            // remove all elements after current history index
            currentHistory.RemoveRange(currentHistoryIndex + 1, currentHistory.Count - (currentHistoryIndex + 1));

            currentHistory.Add(eventArgs.SelectedItems);
            currentHistoryIndex++;
        }
        /// <summary>
        /// Callback from SelectionChangedEvent. 
        /// Executes UpdatePropertyGrid asynchronously on the thread Dispatcher.Current is associated with.
        /// </summary>
        /// <param name="eventArgs">SelectionChangedEventArgs.</param>
        protected virtual void ReactOnViewSelection(SelectionChangedEventArgs eventArgs)
        {
            this.selectedItemsCollection = eventArgs.SelectedItems;

            if (this.IsInitialized && this.IsDockingPaneVisible)
                Threading.DispatcherExtensions.InvokeAsynchronouslyInBackground(
                    System.Windows.Threading.Dispatcher.CurrentDispatcher, new Action(UpdateDependenciesVM));
        }
        /// <summary>
        /// Callback from SelectionChangedEvent.
        /// </summary>
        /// <param name="eventArgs">SelectionChangedEventArgs.</param>
        protected override void ReactOnViewSelection(SelectionChangedEventArgs eventArgs)
        {
            if (eventArgs.SourceViewModel != this)
            {
                this.selectedItemsCollection = eventArgs.SelectedItems;

                Tum.PDE.ToolFramework.Modeling.Visualization.ViewModel.Threading.DispatcherExtensions.InvokeAsynchronouslyInBackground(
                    System.Windows.Threading.Dispatcher.CurrentDispatcher, new Action(UpdateSelectedElement));
            }
        }
 /// <summary>
 /// Callback from SelectionChangedEvent.
 /// </summary>
 /// <param name="eventArgs">SelectionChangedEventArgs.</param>
 protected virtual void ReactOnViewSelection(SelectionChangedEventArgs eventArgs)
 {
     this.selectedItemsCollection = eventArgs.SelectedItems;
 }