private void MenuItem_RootFolderChild(object sender, RoutedEventArgs e)
        {
            if (activeProject == null)
            {
                MessageBox.Show("Please select a Project", "Error"
                                , MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }
            var menuItem = (MenuItem)sender;
            //Get the ContextMenu to which the menuItem belongs
            var contextMenu = (ContextMenu)menuItem.Parent;
            //Find the placementTarget
            var item = (TreeViewItem)contextMenu.PlacementTarget;
            //Get the underlying item
            Folder folder;

            if (item.Header.ToString() == "Plans")
            {
                folder = activeProject.Plans;
            }
            else if (item.Header.ToString() == "Project Files")
            {
                folder = activeProject.ProjectFiles;
            }
            else
            {
                //this should never happen
                return;
            }

            var dialog = new InputDialog("Please enter the folder name:", "Example Folder");

            dialog.ResizeMode = ResizeMode.NoResize;
            dialog.ShowDialog();
            if (dialog.DialogResult == true)
            {
                folder.AddSubFolder(dialog.Answer);
            }

            dialog.Close();
            //refresh layout
            TreeViewFolder.Items.Refresh();
            TreeViewPlans.Items.Refresh();
            TreeViewProjects.Items.Refresh();
        }
        private void MenuItem_RenameProject(object sender, RoutedEventArgs e)
        {
            //Get the clicked MenuItem
            var menuItem = (MenuItem)sender;

            //Get the ContextMenu to which the menuItem belongs
            var contextMenu = (ContextMenu)menuItem.Parent;

            //Find the placementTarget
            var item = (DataGrid)contextMenu.PlacementTarget;

            //Get the underlying item
            var toModifyFromList = (Bim360Project)item.SelectedCells[0].Item;

            if (toModifyFromList == null)
            {
                MessageBox.Show("Please select a project from the list", "Error"
                                , MessageBoxButton.OK, MessageBoxImage.Error);
                return;
            }

            var previousName = toModifyFromList.ProjectName;

            var dialog = new InputDialog("Please enter the new Project name:", previousName)
            {
                ResizeMode = ResizeMode.NoResize
            };

            // show dialog
            dialog.ShowDialog();

            // process answer
            if (dialog.DialogResult == true)
            {
                toModifyFromList.ProjectName = dialog.Answer;
            }
            dialog.Close();

            //refresh layout
            ProjectsView.Items.Refresh();
        }