title: DependencyProperty ObservableCollection event
body: <p>I am trying to make UserControl (GridSearch) which has another UserControl_2 inside. I want to add some FrameworkElements to panel of UserControl_2 using XAML.</p>
  
  <p>So I did ObservableCollection DependencyProperty in GridSearch:    </p>
  
  <pre><code>public partial class GridSearch : UserControl
  {
      public GridSearch()
      {
          InitializeComponent();
      }
  
      public ObservableCollection&lt;Filter&gt; Filters
      {
          get { return (ObservableCollection&lt;Filter&gt;)GetValue(FiltersProperty); }
          set { SetValue(FiltersProperty, value); }
      }
  
      public static readonly DependencyProperty FiltersProperty =
          DependencyProperty.Register("Filters",
                                      typeof(ObservableCollection&lt;Filter&gt;), 
                                      typeof(GridSearch),
                                      new FrameworkPropertyMetadata(getObservableFilters(), null)
                                      );
  
      private static ObservableCollection&lt;Filter&gt; getObservableFilters()
      {
          var ob = new ObservableCollection&lt;Filter&gt;();
          ob.CollectionChanged += ob_CollectionChanged;
          return ob;
      }
  
      private static void ob_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
      {
  
      }
  }
  </code></pre>
  
  <p>Now I was trying to add new elements to the panel by using ob_CollectionChanged. However because it is static method I cannot access the panel. I cannot cast the sender because it gives me only the ObservableCollection. However I need GridSearch. </p>
  
  <p>I am looking for solution from several hours and I am not able to find any idea how to solve it.</p>