title: UserControl binding to observablecollection not working
body: <p>I looked around but still can't find a solution...</p>
  
  <p>I made a <code>UserControl</code> which is basically a slider but with few custom features.</p>
  
  <pre><code>public partial class CustomSlider : UserControl
  {
      public CustomSlider()
      {
          InitializeComponent();
          this.DataContext = this;
  
          CMiXSlider.ApplyTemplate();
          Thumb thumb0 = (CMiXSlider.Template.FindName("PART_Track", CMiXSlider) as Track).Thumb;
          thumb0.MouseEnter += new MouseEventHandler(thumb_MouseEnter);
      }
  
      private void thumb_MouseEnter(object sender, MouseEventArgs e)
      {
          if (e.LeftButton == MouseButtonState.Pressed &amp;&amp; e.MouseDevice.Captured == null)
          {
              MouseButtonEventArgs args = new MouseButtonEventArgs(e.MouseDevice, e.Timestamp, MouseButton.Left);
              args.RoutedEvent = MouseLeftButtonDownEvent;
              (sender as Thumb).RaiseEvent(args);
          }
      }
  
      public static readonly DependencyProperty ValueProperty =
      DependencyProperty.Register("Value", typeof(double), typeof(CustomSlider), new PropertyMetadata(0.0));
      public double Value
      {
          get { return (double)this.GetValue(ValueProperty); }
          set { this.SetValue(ValueProperty, value); }
      }
  }
  </code></pre>
  
  <p>The XAML :</p>
  
  <pre><code>&lt;UserControl x:Class="CMiX.CustomSlider"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
           xmlns:local="clr-namespace:CMiX"
           mc:Ignorable="d" 
           d:DesignHeight="139.8" d:DesignWidth="546.2"&gt;
  &lt;UserControl.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary Source="/CMiX_UserControl;component/RessourceDictionnaries/Brushes/GenericBrushes.xaml"/&gt;
              &lt;ResourceDictionary Source="/CMiX_UserControl;component/RessourceDictionnaries/Styles/BaseSliderStyle.xaml"/&gt;
          &lt;/ResourceDictionary.MergedDictionaries&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/UserControl.Resources&gt;
  &lt;Grid&gt;
      &lt;Slider x:Name="CMiXSlider" Style="{StaticResource BaseSliderStyle}" 
              Value="{Binding Value, Mode=TwoWay, RelativeSource={RelativeSource AncestorType={x:Type local:CustomSlider}}}" 
              IsMoveToPointEnabled="True" Minimum="0.0" Maximum="1.0"/&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>Then I use it inside another <code>UserControl</code> as so : </p>
  
  <pre><code>&lt;CMiX:CustomSlider x:Name="SliderTest" Grid.Row="2" Value="{Binding ChannelsAlpha[0], Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/&gt;
  </code></pre>
  
  <p>And I'm trying to bind to this <code>ObservableCollection</code> (the same slider will be used 6 times) :</p>
  
  <pre><code>private ObservableCollection&lt;double&gt; _ChannelsAlpha = new ObservableCollection&lt;double&gt;(new[] { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 });
      public ObservableCollection&lt;double&gt; ChannelsAlpha
      {
          get { return _ChannelsAlpha; }
          set { _ChannelsAlpha = value; }
      }
  </code></pre>
  
  <p>Problem is, binding is not happening in any way. And what I particularly don't get is if I use this standard slider : </p>
  
  <pre><code>&lt;Slider x:Name="Ch0_Alpha" Margin="1" IsMoveToPointEnabled="True" Minimum="0.0" Maximum="1.0" Orientation="Horizontal" Value="{Binding DataContext.ChannelsAlpha[0], ElementName=Ch0_Alpha, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/&gt;
  </code></pre>
  
  <p>Then it's working as expected.</p>