Beispiel #1
0
 private void mnuItmNone_Click(object sender, RoutedEventArgs e)
 {
     // No Bullet List
     Windows.UI.Text.ITextSelection selectedText = editor.Document.Selection;
     if (selectedText != null)
     {
         Windows.UI.Text.ITextParagraphFormat paraFormatting = selectedText.ParagraphFormat;
         paraFormatting.ListType      = Windows.UI.Text.MarkerType.None;
         selectedText.ParagraphFormat = paraFormatting;
     }
 }
Beispiel #2
0
 private void mnuItmLowerRomanNumeral_Click(object sender, RoutedEventArgs e)
 {
     // Lowercase Roman Numeral List - Ex: i), ii), iii)...
     Windows.UI.Text.ITextSelection selectedText = editor.Document.Selection;
     if (selectedText != null)
     {
         Windows.UI.Text.ITextParagraphFormat paraFormatting = selectedText.ParagraphFormat;
         paraFormatting.ListType      = Windows.UI.Text.MarkerType.LowercaseRoman;
         selectedText.ParagraphFormat = paraFormatting;
     }
 }
Beispiel #3
0
 private void mnuItmLowerEngLetter_Click(object sender, RoutedEventArgs e)
 {
     // Lowercase English Letter List - Ex: a), b), c)...
     Windows.UI.Text.ITextSelection selectedText = editor.Document.Selection;
     if (selectedText != null)
     {
         Windows.UI.Text.ITextParagraphFormat paraFormatting = selectedText.ParagraphFormat;
         paraFormatting.ListType      = Windows.UI.Text.MarkerType.LowercaseEnglishLetter;
         selectedText.ParagraphFormat = paraFormatting;
     }
 }
Beispiel #4
0
 private void btnAlignRight_Checked(object sender, RoutedEventArgs e)
 {
     // Enable Right Align Text
     Windows.UI.Text.ITextSelection selectedText = editor.Document.Selection;
     if (selectedText != null)
     {
         Windows.UI.Text.ITextParagraphFormat paraFormatting = selectedText.ParagraphFormat;
         paraFormatting.Alignment     = Windows.UI.Text.ParagraphAlignment.Right;
         selectedText.ParagraphFormat = paraFormatting;
     }
     btnAlignLeft.IsChecked   = false;
     btnAlignCenter.IsChecked = false;
 }
Beispiel #5
0
        private void btnAlignCenter_Unchecked(object sender, RoutedEventArgs e)
        {
            // Disable Center Align Text
            //Windows.UI.Text.ITextSelection selectedText = editor.Document.Selection;
            //if (selectedText != null)
            //{
            //    Windows.UI.Text.ITextParagraphFormat paraFormatting = selectedText.ParagraphFormat;
            //    paraFormatting.Alignment = Windows.UI.Text.ParagraphAlignment.Left;
            //    selectedText.ParagraphFormat = paraFormatting;
            //}
            //btnAlignLeft.IsChecked = false;
            //btnAlignCenter.IsChecked = false;

            if (btnAlignRight.IsChecked == true)
            {
                Windows.UI.Text.ITextSelection selectedText = editor.Document.Selection;
                if (selectedText != null)
                {
                    Windows.UI.Text.ITextParagraphFormat paraFormatting = selectedText.ParagraphFormat;
                    paraFormatting.Alignment     = Windows.UI.Text.ParagraphAlignment.Right;
                    selectedText.ParagraphFormat = paraFormatting;
                }
                btnAlignLeft.IsChecked   = false;
                btnAlignCenter.IsChecked = false;
            }
            else if (btnAlignLeft.IsChecked == true)
            {
                Windows.UI.Text.ITextSelection selectedText = editor.Document.Selection;
                if (selectedText != null)
                {
                    Windows.UI.Text.ITextParagraphFormat paraFormatting = selectedText.ParagraphFormat;
                    paraFormatting.Alignment     = Windows.UI.Text.ParagraphAlignment.Left;
                    selectedText.ParagraphFormat = paraFormatting;
                }
                btnAlignCenter.IsChecked = false;
                btnAlignRight.IsChecked  = false;
            }
            else
            {
                // Disable Center Align Text
                Windows.UI.Text.ITextSelection selectedText = editor.Document.Selection;
                if (selectedText != null)
                {
                    Windows.UI.Text.ITextParagraphFormat paraFormatting = selectedText.ParagraphFormat;
                    paraFormatting.Alignment     = Windows.UI.Text.ParagraphAlignment.Left;
                    selectedText.ParagraphFormat = paraFormatting;
                }
            }
        }