title: Cannot override inherited member SelectTemplate... with code I copied from MSDN
body: <p>I have an override problem.  I know you can't override inherited members unless they are marked virtual, abstract or override, but...</p>
  
  <p>I have  <a href="http://msdn.microsoft.com/en-us/library/ms742521.aspx" rel="nofollow" title="this code">this code</a> from msdn:</p>
  
  <pre><code>using System.Windows;
  using System.Windows.Controls;
  
  namespace SDKSample
  {
      public class TaskListDataTemplateSelector : DataTemplateSelector
      {
          public override DataTemplate
              SelectTemplate(object item, DependencyObject container)
          {
              FrameworkElement element = container as FrameworkElement;
  
              if (element != null &amp;&amp; item != null &amp;&amp; item is Task)
              {
                  Task taskitem = item as Task;
  
                  if (taskitem.Priority == 1)
                      return
                          element.FindResource("importantTaskTemplate") as DataTemplate;
                  else 
                      return
                          element.FindResource("myTaskTemplate") as DataTemplate;
              }
  
              return null;
          }
      }
  }
  </code></pre>
  
  <p>And I added this code:</p>
  
  <pre><code>public class PostTemplateSelector : DataTemplateSelector
  {
      public override DataTemplate SelectTemplate(object item, DependencyObject container)
      {
          ListViewItem lvi = item as ListViewItem;
  
          AppNetClient.PostClass key = lvi.DataContext as AppNetClient.PostClass;
  
          if (key.postTemplate == "Post")
          {
              return lvi.FindName("PostDataTemplate") as DataTemplate;
          }
          else
          {
              return lvi.FindName("SelectedPostDataTemplate") as DataTemplate;
          }
      }
  }
  </code></pre>
  
  <p>And I get this error:</p>
  
  <pre><code>Error   3   'oneSocialLife.MainPage.PostTemplateSelector.SelectTemplate(object, Windows.UI.Xaml.DependencyObject)': cannot override inherited member 'Windows.UI.Xaml.Controls.DataTemplateSelector.SelectTemplate(object, Windows.UI.Xaml.DependencyObject)' because it is not marked virtual, abstract, or override   C:\Users\kcone\documents\visual studio 2012\Projects\HttpClientApp\HttpClientApp\MainPage.xaml.cs   339 42  oneSocialLife
  </code></pre>
  
  <p>I've spent hours looking for why, but can't figure it out.  Any ideas?</p>