protected override void OnExecute(object parameter)
 {
     if (parameter is BookmarkTableTreeViewItemViewModel viewModel)
     {
         var browser   = viewModel.Browser;
         var itemPaths = viewModel.Browser.GetBookmarkItemPaths();
         var dialog    = new MoveBookmarkItemViewModel(viewModel.BookmarkPath, itemPaths);
         if (dialog.ShowDialog() == true)
         {
             if (browser.GetBookmarkItem(dialog.TargetPath) is BookmarkCategoryTreeViewItemViewModel categoryViewModel)
             {
                 viewModel.Parent = categoryViewModel;
             }
         }
     }
 }
 protected async override void OnExecute(object parameter)
 {
     if (parameter is BookmarkTypeTreeViewItemViewModel viewModel)
     {
         var browser   = viewModel.Browser;
         var itemPaths = viewModel.Browser.GetBookmarkItemPaths();
         var dialog    = new MoveBookmarkItemViewModel(this.ServiceProvider, viewModel.BookmarkPath, itemPaths);
         if (await dialog.ShowDialogAsync() == true)
         {
             if (browser.GetBookmarkItem(dialog.TargetPath) is BookmarkCategoryTreeViewItemViewModel categoryViewModel)
             {
                 viewModel.Parent = categoryViewModel;
             }
         }
     }
 }
Exemple #3
0
        // 북마크 폴더 이동
        public void Move()
        {
            var itemPaths = this.Browser.GetBookmarkItemPaths();
            var dialog    = new MoveBookmarkItemViewModel(this.Path, itemPaths);

            if (dialog.ShowDialog() != true)
            {
                return;
            }

            try
            {
                var parentViewModel = this.Browser.GetBookmarkItem(dialog.TargetPath);
                this.Parent       = parentViewModel;
                this.categoryName = new CategoryName(dialog.TargetPath, this.categoryName.Name);
                this.Browser.UpdateBookmarkItems();
            }
            catch (Exception e)
            {
                AppMessageBox.ShowError(e);
            }
        }
        // 북마크 폴더 이동
        public async Task MoveAsync()
        {
            var itemPaths = this.Browser.GetBookmarkItemPaths();
            var dialog    = new MoveBookmarkItemViewModel(this.ServiceProvider, this.Path, itemPaths);

            if (await dialog.ShowDialogAsync() != true)
            {
                return;
            }

            try
            {
                var parentViewModel = this.Browser.GetBookmarkItem(dialog.TargetPath);
                this.Parent       = parentViewModel;
                this.categoryName = new CategoryName(dialog.TargetPath, this.categoryName.Name);
                this.Browser.UpdateBookmarkItems();
            }
            catch (Exception e)
            {
                await AppMessageBox.ShowErrorAsync(e);
            }
        }