title: Is it possible to use an nameof expression in switch statement?
body: <p>The new <a href="https://msdn.microsoft.com/en-us/magazine/dn802602.aspx" rel="noreferrer">C# 6.0 <code>nameof</code></a> is great in the <code>PropertyChanged</code> pattern for propagating property changes using something like:</p>
  
  <pre><code>private string _myProperty;
  
  public string MyProperty
  {
      get
      {
          return _myProperty;
      }
      set
      {
          _myProperty= value;
          OnPropertyChanged(nameof(MyProperty));
      }
  }
  </code></pre>
  
  <p>When listening of property changes I use this (yes, even with ugly hardcoded strings):</p>
  
  <pre><code>    private void OnMyObjectPropertyChanged(object sender, PropertyChangedEventArgs args)
      {
          switch (args.PropertyName)
          {
              case "MyProperty":
                  DoSomething();
                  break;
          }
      }
  </code></pre>
  
  <p>With the new nameof expressions would this code compile / work?</p>
  
  <pre><code>private void OnMyObjectPropertyChanged(object sender, PropertyChangedEventArgs args)
  {
      switch (args.PropertyName)
      {
          case nameof(MyObject.MyProperty):
              DoSomething();
              break;
      }
  }
  </code></pre>