title: WPF: Can't instantiate class in Window.Resources
body: <p>I'm doing this WPF tutorial and for some reason I get an error when adding a custom <code>SlidersToColorConverter</code> class to resources.</p>
  
  <p>Someone on StackOverflow was doing it exact same way.</p>
  
  <p><strong>MainWindow.xaml</strong>:</p>
  
  <pre><code>&lt;Window x:Class="WpfApplication2.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:WpfApplication2"
      Title="MainWindow" Height="350" Width="525"&gt;
  
      &lt;Window.Resources&gt;
          &lt;local:SlidersToColorConverter x:Key="whyareyounotworking"/&gt;
      &lt;/Window.Resources&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p><strong>SlidersToColorConverter.cs</strong>:</p>
  
  <pre><code>namespace WpfApplication2
  {
      class SlidersToColorConverter : IMultiValueConverter
      {
          public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
          {
              double red = (double)values[0];
              double green = (double)values[1];
              double blue = (double)values[2];
              return new SolidColorBrush(Color.FromArgb(255, (byte)red, (byte)green, (byte)blue));
          }
  
          public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
          {
              throw new NotImplementedException();
          }
      }
  }
  </code></pre>
  
  <p><strong>Error List</strong>:</p>
  
  <pre><code>The name "SlidersToColorConverter" does not exist in the namespace "clr-namespace:WpfApplication2". c:\users\mateusz\documents\visual studio 2013\Projects\WpfApplication2\WpfApplication2\MainWindow.xaml  39  9   WpfApplication2
  </code></pre>