title: wpf richtextbox: error on "decor == TextDecorations.Strikethrough"
body: <p>trying to detect if Selected Text in RichTextbox is underline or strikethrough..  Get a Syntax error on the function calls..  not sure how to resolve.</p>
  <p>I have it working for the case of Bold and Italics however.  Seems like TextDecorations doesn't exists in .NET library in a similar way as Bold and Italics cases?</p>
  <pre><code>&lt;Window x:Class=&quot;WpfApp1.MainWindow&quot;
          xmlns=&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;
          xmlns:x=&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;
          xmlns:d=&quot;http://schemas.microsoft.com/expression/blend/2008&quot;
          xmlns:mc=&quot;http://schemas.openxmlformats.org/markup-compatibility/2006&quot;
          xmlns:local=&quot;clr-namespace:WpfApp1&quot;
          mc:Ignorable=&quot;d&quot;
          Title=&quot;MainWindow&quot; Height=&quot;450&quot; Width=&quot;800&quot;&gt;
  &lt;Grid&gt;
     &lt;RichTextBox Name=&quot;RichTextBox1&quot;/&gt;
  &lt;/Grid&gt;
  &lt;/Window&gt;
  </code></pre>
  <pre><code>using System.Windows;
  using System.Windows.Controls;
  using System.Windows.Documents;
  using System.Windows.Media;
  namespace WpfApp1
  {
      public partial class MainWindow : Window
      {
          public MainWindow()
          {
              InitializeComponent();
          }
  
          private bool SelectionIsStrikethrough()
          {
              var decor = RichTextBox1.Selection.GetPropertyValue(TextDecorationsProperty);
              var unset = DependencyProperty.UnsetValue;
              var SelectionIsStrike = decor != unset &amp;&amp; (TextDecorations)decor == TextDecorations.Strikethrough;
              return SelectionIsStrike;
          }
  
          private bool SelectionIsUnderline()
          {
              var decor = RichTextBox1.Selection.GetPropertyValue(TextDecorationsProperty);
              var unset = DependencyProperty.UnsetValue;
              var SelectionIsStrike = decor != unset &amp;&amp; (TextDecorations)decor == TextDecorations.Underline;
              return SelectionIsStrike;
          }
          
          private bool SelectionIsBold()
          {
              var weight = RichTextBox1.Selection.GetPropertyValue(FontWeightProperty);
              var unset = DependencyProperty.UnsetValue;
              var SelectionIsBold = weight != unset &amp;&amp; (FontWeight)weight == FontWeights.Bold;
              return SelectionIsBold;
          }
          private bool SelectionIsItalic()
          {
              var style = RichTextBox1.Selection.GetPropertyValue(FontStyleProperty);
              var unset = DependencyProperty.UnsetValue;
              var SelectionIsItalic = style != unset &amp;&amp; (FontStyle)style == FontStyles.Italic;
              return SelectionIsItalic;
          }
      }       
  }
  </code></pre>