private void TreeView_OnSelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
        {
            var folderViewModel = e.NewValue as FolderViewModel;

            if (folderViewModel != null)
            {
                SelectedFolder = folderViewModel.Folder;
            }
        }
 public BaseFoldersViewModel(Folder[] baseFolders)
 {
     _folders = new ReadOnlyCollection<FolderViewModel>(
         baseFolders.Select(x => new FolderViewModel(x)).OrderBy(x => x.Folder.Name).ToArray());
 }
		private void detach_Folders(Folder entity)
		{
			this.SendPropertyChanging();
			entity.Folder1 = null;
		}
		private void attach_Folders(Folder entity)
		{
			this.SendPropertyChanging();
			entity.Folder1 = this;
		}
 partial void DeleteFolder(Folder instance);
 partial void UpdateFolder(Folder instance);
 partial void InsertFolder(Folder instance);
 public FolderViewModel(Folder folder)
     : base(null, true)
 {
     _folder = folder;
 }