Beispiel #1
0
        private void Done_Click_1(object sender, RoutedEventArgs e)
        {
            // TODO: Investigate if Frame.DataContext is the best way to pass data on a GoBack(),
            // since GoBack does not have a "parameter".

            preTag.Text       = ContentBuilder.TextToPre(contentTextBox.Text);
            Frame.DataContext = preTag;
            Frame.GoBack();
        }
Beispiel #2
0
 /// <summary>
 /// Invoked when this page is about to be displayed in a Frame.
 /// </summary>
 /// <param name="e">Event data that describes how this page was reached.  The Parameter
 /// property is typically used to configure the page.</param>
 protected override void OnNavigatedTo(NavigationEventArgs e)
 {
     preTag = e.Parameter as PreTag;
     if (preTag.ComesFromFile)
     {
         contentTextBox.Text = preTag.Text.Trim();
     }
     else
     {
         contentTextBox.Text = ContentBuilder.PreToText(preTag.Text);
     }
 }
Beispiel #3
0
        private async void TextBox_ContextMenuOpening(object sender, ContextMenuEventArgs e)
        {
            TextBox textBox = (TextBox)sender;
            PreTag  preTag  = ContentBuilder.GetPreTag(textBox);

            if (preTag != null)
            {
                e.Handled = true;

                // Create a menu and add commands specifying an id value for each instead of a delegate.
                var menu = new PopupMenu();
                menu.Commands.Add(new UICommand("Edit <pre> tag.", null, 2));
                var chosenCommand = await menu.ShowAsync(new Point(e.CursorLeft, e.CursorTop));

                if (chosenCommand != null)
                {
                    if (chosenCommand.Label.StartsWith("Edit"))
                    {
                        Frame.Navigate(typeof(PreEditorPage), preTag);
                    }
                }
            }
        }
Beispiel #4
0
 private void AddIdentation_Click_1(object sender, RoutedEventArgs e)
 {
     contentTextBox.Text = ContentBuilder.AddIdentation(contentTextBox.Text);
 }