public void UpdateSubItems()
 {
     Items.Clear();
     foreach (RDAFolder rdaFolder in Enumerable.OrderBy(Folder.Folders, f => f.Name))
     {
         RDAFolderTreeViewItem folderTreeViewItem = new RDAFolderTreeViewItem();
         folderTreeViewItem.Folder = rdaFolder;
         folderTreeViewItem.Header = ControlExtension.BuildImageTextblock("pack://application:,,,/Images/Icons/folder.png", rdaFolder.Name);
         Items.Add(folderTreeViewItem);
         if ((TreeViewExtension.GetTreeView(this) as MultiSelectTreeView).SelectedItems.Contains(this))
         {
             (TreeViewExtension.GetTreeView(this) as MultiSelectTreeView).SelectItem(folderTreeViewItem);
             (TreeViewExtension.GetTreeView(this) as MultiSelectTreeView).UpdateSelectedItems();
         }
     }
     foreach (RDAFile file in Enumerable.OrderBy(Folder.Files, f => f.FileName))
     {
         RDAFileTreeViewItem fileTreeViewItem = RDAFileExtension.ToTreeViewItem(file);
         fileTreeViewItem.SelectOnRightClick = true;
         Items.Add(fileTreeViewItem);
         if ((TreeViewExtension.GetTreeView(this) as MultiSelectTreeView).SelectedItems.Contains(this))
         {
             (TreeViewExtension.GetTreeView(this) as MultiSelectTreeView).SelectItem(fileTreeViewItem);
             (TreeViewExtension.GetTreeView(this) as MultiSelectTreeView).UpdateSelectedItems();
         }
     }
     AlreadyExpanded = true;
     IsExpanded      = true;
 }
 private void context_Delete_Click(object sender, RoutedEventArgs e)
 {
     if (MessageWindow.Show("Do you really want to delete this folder?", MessageWindow.MessageWindowType.YesNo) != MessageBoxResult.Yes)
     {
         return;
     }
     Folder.Parent.Folders.Remove(Folder);
     if (Parent == TreeViewExtension.GetTreeView((TreeViewItem)this))
     {
         MainWindow.CurrentMainWindow.RebuildTreeView();
     }
     else
     {
         (Parent as RDAFolderTreeViewItem).UpdateSubItems();
     }
 }