title: XmlDataProvider Refresh source WPF
body: <p>I have a WPF Grid</p>
  
  <pre><code>&lt;Window x:Class="LabsRSS.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Poperecinii Timur Lab" Height="404" Width="588"&gt;
  &lt;Grid x:Name="blah"&gt;
      &lt;Grid.Resources&gt;
          &lt;XmlDataProvider x:Key="flickrdata" Source="http://api.flickr.com/services/feeds/photos_public.gne?tags=dog&amp;amp;lang=en-us&amp;amp;format=rss_200"&gt;
              &lt;XmlDataProvider.XmlNamespaceManager&gt;
                  &lt;XmlNamespaceMappingCollection&gt;
                      &lt;XmlNamespaceMapping Prefix="media" Uri="http://search.yahoo.com/mrss/"/&gt;
                  &lt;/XmlNamespaceMappingCollection&gt;
              &lt;/XmlDataProvider.XmlNamespaceManager&gt;
          &lt;/XmlDataProvider&gt;
          &lt;DataTemplate x:Key="itemTemplate"&gt;
              &lt;Image Width="75" Height="75" Source="{Binding Mode=OneWay, XPath=media:thumbnail/@url}"/&gt;
          &lt;/DataTemplate&gt;
          &lt;ControlTemplate x:Key="controlTemplate" TargetType="{x:Type ItemsControl}"&gt;
              &lt;WrapPanel IsItemsHost="True" Orientation="Horizontal"/&gt;
          &lt;/ControlTemplate&gt;
      &lt;/Grid.Resources&gt;
      &lt;ItemsControl
     Width="375"
     ItemsSource="{Binding Mode=Default, Source={StaticResource flickrdata}, XPath=/rss/channel/item}"
     ItemTemplate="{StaticResource itemTemplate}"
     Template="{StaticResource controlTemplate}"&gt;
      &lt;/ItemsControl&gt;
      &lt;TextBox Height="23" Margin="193,0,213,24" Name="textBox1" VerticalAlignment="Bottom" TextChanged="textBox1_TextChanged" /&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>What I try to do is to replace the tag with my own input from TextBox.</p>
  
  <pre><code> private void textBox1_TextChanged(object sender, TextChangedEventArgs e)
      {
          XmlDataProvider dataProvider = (XmlDataProvider)this.blah.FindResource("flickrdata");
          XmlNamespaceManager xnManager = dataProvider.XmlNamespaceManager;
          string newSource = "http://api.flickr.com/services/feeds/photos_public.gne?tags=flower&amp;amp;lang=en-us&amp;amp;format=rss_200";
          newSource = Regex.Replace(newSource, "(^.*tags=)(.+?)(&amp;amp;.*$)", String.Format("{0}{1}{2}", "$1", textBox1.Text, "$3"));
          dataProvider.Source = new Uri(newSource);
          dataProvider.XmlNamespaceManager = xnManager;
          dataProvider.Refresh();
  
      }
  </code></pre>
  
  <p>Now the uri seems to be set good but the dataProvider is not refreshing the content, how can I do it?</p>