title: WPF How to refresh data on the Main Form MainWindow.xaml
body: <p>I inherited a WPF application that someone else wrote. I have some familiarity with xaml forms from having written a Silverlight application about a year ago. But I haven't done a lot with  it. </p>
  
  <p>The Main Window displays a grid. It then opens up a couple of other xaml forms. One of these changes some of the data in the Main form. If I close the app and reopen it the new data shows. This is ok but I prefer for the grid to dynamically change when the data changes. I can't access any of the public properties of the main form. The main form is open in the app.xaml with the following code: </p>
  
  <pre><code>&lt;Application x:Class="NRCME_Client.App"
               xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
               xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
               StartupUri="MainWindow.xaml"&gt;
      &lt;Application.Resources&gt;
  
      &lt;/Application.Resources&gt;
  &lt;/Application&gt;
  </code></pre>
  
  <p>I realize the problem is probably that I have not instanced the Main form, but I don't know how to do this. I would know what to do it a Windows form application but not a WPF application. </p>
  
  <p>If it helps, this used a Telerik grid: </p>
  
  <pre><code>&lt;telerik:RadGridView x:Name="MainGrid" Margin="0,50,0,0" SelectionMode="Multiple"&gt;
              &lt;telerik:RadGridView.Columns&gt;
                  &lt;telerik:GridViewSelectColumn /&gt;
              &lt;/telerik:RadGridView.Columns&gt;
          &lt;/telerik:RadGridView&gt;
  </code></pre>
  
  <p>I bind it to the results of a stored procedure: </p>
  
  <pre><code> mDatabase = new DbGateWay();
              clsGlobals.Database = mDatabase;
              MainGrid.ItemsSource = clsGlobals.Database.ExecuteSelect("GetAllContacts");
  </code></pre>
  
  <p>Please help, if you can.</p>