title: C# WPF Update Status bar text and progress from another window
body: <p>I have a Main window named "wpfMenu" With a status bar which contains a text block and progress bar. The status bar needs to be updated from methods which are running on separate windows launched from the Main window (only one window open at any time).</p>
  
  <p>Preferably I would like to pass the min, max, progress, text values to a class called "statusUpdate" to update the progress but i have no idea where to begin and any examples of updating progress bars I've come across are running on the same window.</p>
  
  <p>Here is my code for the Status bar so far</p>
  
  <pre><code>&lt;Window
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:Custom="http://schemas.microsoft.com/winfx/2006/xaml/presentation/ribbon" x:Class="Mx.wpfMenu"
      Title="Mx - Menu" Height="600" Width="1000" Background="#FFF0F0F0" Closed="wpfMenu_Closed"&gt;
  &lt;Grid&gt;
      &lt;StatusBar x:Name="sbStatus" Height="26" Margin="0,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Stretch"&gt;
          &lt;StatusBar.ItemsPanel&gt;
              &lt;ItemsPanelTemplate&gt;
                  &lt;Grid&gt;
                      &lt;Grid.RowDefinitions&gt;
                          &lt;RowDefinition Height="*"/&gt;
                      &lt;/Grid.RowDefinitions&gt;
                      &lt;Grid.ColumnDefinitions&gt;
                          &lt;ColumnDefinition Width="4*"/&gt;
                          &lt;ColumnDefinition Width="Auto"/&gt;
                      &lt;/Grid.ColumnDefinitions&gt;
                  &lt;/Grid&gt;
              &lt;/ItemsPanelTemplate&gt;
          &lt;/StatusBar.ItemsPanel&gt;
          &lt;StatusBarItem&gt;
              &lt;TextBlock Name="sbMessage" Text="{Binding statusUpdate.Message}"/&gt;
          &lt;/StatusBarItem&gt;
          &lt;StatusBarItem Grid.Column="1"&gt;
              &lt;ProgressBar Name="sbProgress" Width="130" Height="18" Minimum="0" Maximum="100" IsIndeterminate="False"/&gt;
          &lt;/StatusBarItem&gt;
      &lt;/StatusBar&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p></p>
  
  <p>The code for my class is </p>
  
  <pre><code>    public class statusUpdate : INotifyPropertyChanged
  {
      private string _message;
      public event PropertyChangedEventHandler PropertyChanged;
  
      public statusUpdate()
      {
  
      }
  
      public statusUpdate (string value)
      {
          this._message = value;
      }
  
      public string Message
      {
          get { return _message; }
          set
          {
              _message = value;
              OnPropertyChanged("Message");
          }
      }
  
      void OnPropertyChanged(string _message)
      {
          PropertyChangedEventHandler handler = PropertyChanged;
          if (handler != null)
          {
              handler(this, new PropertyChangedEventArgs(_message));
          }
      }
  }
  </code></pre>