Example #1
0
        private async void CreateNewFolder()
        {
            var dialog = new TextInputDialog(LocalizationHelper.Localize("Folder name"));
            var result = await dialog.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                var bookmark = new BookmarkNode
                {
                    IsFolder = true,
                    Name     = dialog.Text,
                    Children = new ObservableCollection <BookmarkNode>()
                };
                Bookmarks.Add(bookmark);
                WriteBookmarks();
            }
        }
Example #2
0
        private async void RenameItem(BookmarkNode bookmark)
        {
            var dialog = new TextInputDialog(LocalizationHelper.Localize("New name"));
            var result = await dialog.ShowAsync();

            if (result == ContentDialogResult.Primary)
            {
                var parent = FindParent(bookmark, Bookmarks);
                if (parent != null)
                {
                    for (int i = 0; i < parent.Count; i++)
                    {
                        if (parent[i] == bookmark)
                        {
                            bookmark.Name = dialog.Text;
                            parent[i]     = bookmark;
                            WriteBookmarks();
                        }
                    }
                }
            }
        }