private async void NotesAppBar_Loaded(object sender, RoutedEventArgs e)
 {
     LastUsedNotesAppBar = this;
     Edge = AppBarEdges.Right;
     new ContextTextFormatter(document);
     await LoadOpenNote();
 }
 private void NotesAppBar_Unloaded(object sender, RoutedEventArgs e)
 {
     if (LastUsedNotesAppBar == this)
     {
         LastUsedNotesAppBar = null;
     }
 }
        private static async void SelectedPageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            NotesAppBar notesView = d as NotesAppBar;

            notesView.document.Visibility = e.NewValue != null ? Visibility.Visible : Visibility.Hidden;
            //notesView.background.Background = e.NewValue != null ? Brushes.White : new SolidColorBrush(Color.FromRgb(240, 240, 240));

            if (e.NewValue != null)
            {
                notesView.document.Visibility = Visibility.Visible;
                notesView.document.Document   = await((NotebookPage)e.NewValue).GetDetailsDocumentAsync();
                //	notesView.background.Background = Brushes.White;
                //	notesView.background.IsEnabled = false;
            }
            else
            {
                notesView.document.Visibility = Visibility.Hidden;
                //	notesView.background.Background = new SolidColorBrush(Color.FromRgb(240, 240, 240));
                //	notesView.background.IsEnabled = true;
            }
        }