예제 #1
0
 public void OnFolderChanged(FolderChangedEventArgs e)
 {
     if (FolderChanged != null)
     {
         FolderChanged(this, e);
     }
 }
예제 #2
0
        private void FolderTapped(object sender, Windows.UI.Xaml.Input.TappedRoutedEventArgs e)
        {
            if (!string.IsNullOrEmpty(QueryResults))
            {
                return;
            }

            // Was it the up folder button? If the user clicks on the list view item containing
            // the button, but not ON the button, the correct item is selected. If nothing is
            // selected it means the actual up button was clicked on
            if (ListViewFolders.SelectedIndex == -1)
            {
                ListViewFolders.SelectedIndex = 0;
            }

            try
            {
                var selectedFolder = ListViewFolders.SelectedItem as FolderSummary;
                if (selectedFolder == null)
                {
                    return;
                }

                CurrentSnippetFolder = selectedFolder.Path;
                UpdateViews();

                // Fire an event to tell our host the folder has changed
                var folderChangedEventArgs = new FolderChangedEventArgs {
                    SelectedPath = CurrentSnippetFolder
                };
                OnFolderChanged(folderChangedEventArgs);
            }
            catch
            {
                ShowMessage("Unable to change to folder:\n\n" + CurrentSnippetFolder);
            }
        }