title: Workaround to avoid "Cannot create default converter to perform 'two-way' conversions between types 'Derived_N' and 'Base'" error
body: <p>I have some types hierarchy:</p>
  
  <pre><code>public class Base {}
  public class Derived_1 : Base {}
  public class Derived_2 : Base {}
  // more descendants...
  public class Derived_N : Base {}
  </code></pre>
  
  <p>Types from this hierarchy are used as lookup lists in view models:</p>
  
  <pre><code>public class SomeViewModel
  {
      // available items
      public IEnumerable&lt;Derived_N&gt; SomeItems { get; }
  
      // currently selected item
      public Derived_N SelectedItem { get; set; }
  
      // there could be several property pairs as above
  }
  </code></pre>
  
  <p>To select values from lookup list I've created user control (some sort of selector). Since from the point of selection process all <code>Base</code> descendants looks similar, user control operates <code>Base</code> type properties:</p>
  
  <pre><code>    public IEnumerable&lt;Base&gt; ItemsSource
      {
          get { return (IEnumerable&lt;Base&gt;)GetValue(ItemsSourceProperty); }
          set { SetValue(ItemsSourceProperty, value); }
      }
  
      public static readonly DependencyProperty ItemsSourceProperty =
          DependencyProperty.Register("ItemsSource", typeof(IEnumerable&lt;Base&gt;), typeof(BaseSelector), new PropertyMetadata(null));
  
      public Base SelectedItem
      {
          get { return (Base)GetValue(SelectedItemProperty); }
          set { SetValue(SelectedItemProperty, value); }
      }
  
      public static readonly DependencyProperty SelectedItemProperty =
          DependencyProperty.Register("SelectedItem", typeof(Base), typeof(BaseSelector), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
  </code></pre>
  
  <p>XAML usually looks like:</p>
  
  <pre><code>&lt;myCtrls:BaseSelector ItemsSource="{Binding SomeItems}"
                        SelectedItem="{Binding SelectedItem}"/&gt;
  </code></pre>
  
  <p>This works as expected, but there are binding errors like this:</p>
  
  <blockquote>
    <p>Cannot create default converter to perform 'two-way' conversions
    between types 'Derived_N' and 'Base'</p>
  </blockquote>
  
  <p>I know, <em>why</em> they are in output window - in theory, <code>SelectedItem</code> could be any type, derived from <code>Base</code>, but in practice this is not my case.
  The error disappears, if this converter:</p>
  
  <pre><code>public class DummyConverter : IValueConverter
  {
      public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
      {
          return value;
      }
  
      public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
      {
          return value;
      }
  }
  </code></pre>
  
  <p>is used in binding:</p>
  
  <pre><code>&lt;myCtrls:BaseSelector ItemsSource="{Binding SomeItems}"
                        SelectedItem="{Binding SelectedItem, Converter={StaticResource DummyConverterKey}}"/&gt;
  </code></pre>
  
  <p>but I don't want to use it at all - as you can see, there are no any payload in that converter (while there are lot such of properties).</p>
  
  <p>Are there any other workaround?</p>