title: Call the method in an internal function c#
body: <p>i want to pass string value from function to internal function.</p>
  
  <pre><code>private void datagrid_customer_SelectionChanged(object sender, SelectionChangedEventArgs e)
  {
      for (int i = 0; i &lt; datagrid_customer.Items.Count; i++)
      {
          if (Convert.ToString((datagrid_customer.SelectedCells[3].Column.GetCellContent(datagrid_customer.SelectedItem) as TextBlock).Text) == Convert.ToString((datagrid_customer.SelectedCells[1].Column.GetCellContent(datagrid_customer.Items[i]) as TextBlock).Text))
          {
              ...
              string a = (b + c + d).ToString();       
          }
   }
  </code></pre>
  
  <p>I want to pass <code>a</code> to another function </p>
  
  <pre><code>datagrid_customer.SelectAll();
  
  for (int i = 0; i &lt; datagrid_customer.Items.Count; i++)
  {
      if (Convert.ToString((datagrid_customer.SelectedCells[43].Column.GetCellContent(datagrid_customer.Items[i]) as TextBlock).Text) == "0")
      {
          ...
           txt_f1.Text = a ;
      }
  }
  </code></pre>
  
  <p>I need to <code>txt_f1.text = a</code> but i dont have access to use <code>a</code>.</p>
  
  <p>what should I do?</p>