title: Access xaml control inside ith item in flipview
body: <p>I have a flipview which is populated by some code (I don't understand how modifying an app). </p>
  
  <pre><code>&lt;FlipView  x:Name="ArticleDetail" Grid.Row="1" AutomationProperties.AutomationId="ItemsFlipView" AutomationProperties.Name="Item Details" TabIndex="1"
               DataContext="{Binding LatestArticlesModel}"
               ItemsSource="{Binding Items}"
               ItemTemplate="{StaticResource LatestArticles1DetailDetail}"
               SelectedItem="{Binding SelectedItem, Mode=TwoWay}"
               ItemContainerStyle="{StaticResource FlipItemStyle}"&gt;
  &lt;/FlipView&gt;
  
  &lt;!--Data template for flipview--&gt;
  &lt;DataTemplate x:Key="LatestArticles1DetailDetail"&gt;
        &lt;ScrollViewer&gt;
          &lt;StackPanel&gt;
               &lt;TextBlock Margin="0,16" 
                    Text="{Binding Title, Converter={StaticResource    TextPlainConverter}, ConverterParameter = 140}" 
                    Style="{StaticResource SubHeaderText}" /&gt;
                &lt;Image Source="{Binding ImageUrl, Converter={StaticResource ThumbnailConverter},      ConverterParameter=300}" Stretch="UniformToFill" /&gt;
                &lt;TextBlock 
                     x:Name="FeedUrl" 
                     Margin="0,12"  Style="{StaticResource Html2XamlStyleText}"
                     Text="{Binding FeedUrl}" 
                     Visibility="Collapsed"/&gt;
                &lt;RichTextBlock 
                      x:Name="Content" 
                      Margin="0,12"  
                      Style="{StaticResource Html2XamlStyle}"/&gt;
              &lt;/StackPanel&gt;
          &lt;/ScrollViewer&gt;
  &lt;/DataTemplate&gt;
  </code></pre>
  
  <p>From the textblock named "FeedUrl" I want to extract the url which is stored in it.</p>
  
  <p>Use the url to parse the html page pointed to by that url</p>
  
  <p>After processing display some content in the richtextblock named "content".</p>
  
  <p>The only problem I am facing in it is how to get reference to the textblock and richtextblock inside each item of the flipview.</p>
  
  <p>For getting reference to items I have tried two solutions:</p>
  
  <hr>
  
  <ol>
  <li>I've tried this <a href="https://stackoverflow.com/questions/17799412/access-to-controls-inside-a-flipview-un-xaml">code</a> but the line</li>
  </ol>
  
  <p><code>var myTextBlock= _Children.OfType&lt;TextBlock&gt;().FirstOrDefault(c =&gt; c.Name.Equals("test"));</code> specifically </p>
  
  <p><code>.OfType&lt;TextBlock&gt;()</code> gives an error</p>
  
  <p><code>'System.Collections.Generic.List&lt;Windows.UI.Xaml.Controls.TextBlock&gt;' does not contain a definition for 'OfType' and no extension method 'OfType' accepting a first argument of type 'System.Collections.Generic.List&lt;Windows.UI.Xaml.Controls.TextBlock&gt;' could be found (are you missing a using directive or an assembly reference?)</code></p>
  
  <hr>
  
  <ol start="2">
  <li>I also tried another solution given <a href="http://social.technet.microsoft.com/wiki/contents/articles/17502.finding-element-in-itemscontrol-datatemplate-listviewgridviewflipview-window-store-apps.aspx" rel="nofollow">here</a>, but I always get a null reference. </li>
  </ol>
  
  <p>I also get a warning for the line </p>
  
  <p><code>var item = itemsControl.ItemContainerGenerator.ContainerFromItem(o); 
  Windows.UI.Xaml.Controls.ItemContainerGenerator.ContainerFromItem(o); is obsolote.'ContainerForm' may be unavailable for releases after Windows Phone 8.1. Use itemsControl.ContainerFromItem instead.</code></p>
  
  <p>Even if I use <code>itemsControl.ContainerFromItem</code> it always returns a null reference.</p>
  
  <p>Please Help</p>
  
  <hr>
  
  <p>UPDATE:</p>
  
  <p>I'm using the following</p>
  
  <pre><code>if(!statusiop.statusup){
  this.UpdateLayout();
  for (int i = 0; i &lt; ArticleDetail.Items.Count; i++)
  {
  var fvItem = this.ArticleDetail.Items[i];
  var container = this.ArticleDetail.ContainerFromItem(fvItem);
   if (container == null)
   {
       Text = "null container";
   }
   else
   {
       var tbFeedURL = FindElementByName&lt;TextBlock&gt;(container, "FeedUrl");
       if (tbFeedURL == null)
       {
           test.Text = "null text";
       }
       else
       {
           tbFeedURL.Text = tbFeedURL.Text + "Test";
       }
   } 
  }
  </code></pre>
  
  <p>I iterate through all the items in the flipview, and modify the data as needed. I am also using a public static class </p>
  
  <pre><code>public static class statusiop
  {
      public static Boolean statusup= false;
  
  }
  </code></pre>
  
  <p>which contains a member statusup. statusup serves as a flag which when true indicates that the flipview data has been updated once and need not be updated again.</p>