title: Progress bar does not updated wpf?
body: <p>I am trying to update my progress bar inside <code>contentrendered(object sender, EventArgs e)</code> event. This is my code :-</p>
  
  <p><strong>MainWindow.xaml.cs</strong></p>
  
  <pre><code>DynamicControls.ProgressBarWindow _progressBarWindow = new DynamicControls.ProgressBarWindow("Please Wait...");
  _progressBarWindow.ShowDialog();
  </code></pre>
  
  <p><strong>XAML</strong></p>
  
  <pre><code>&lt;Window x:Class="nk_Image_Converter.DynamicControls.ProgressBarWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      Title="ProgressBarWindow" Height="100" Width="500" BorderThickness="0" WindowStyle="None" ResizeMode="NoResize" Background="#d4dce6" Loaded="Window_Loaded" Initialized="Window_Initialized" ContentRendered="Window_ContentRendered" LayoutUpdated="Window_LayoutUpdated" Activated="Window_Activated" &gt;
  &lt;Window.Effect&gt;
      &lt;DropShadowEffect Opacity="0.4"/&gt;
  &lt;/Window.Effect&gt;
  &lt;Border BorderBrush="CadetBlue" BorderThickness="3,0,3,3"&gt;
      &lt;Grid&gt;
          &lt;Grid.RowDefinitions&gt;
              &lt;RowDefinition Height="20"/&gt;
              &lt;RowDefinition Height="*"/&gt;
          &lt;/Grid.RowDefinitions&gt;
          &lt;Grid Grid.Row="0" Background="CadetBlue"&gt;&lt;/Grid&gt;
          &lt;Grid Grid.Row="1" Background="Transparent"&gt;
              &lt;Label x:Name="Message" Content="Please Wait..." Margin="42,15"/&gt;
              &lt;ProgressBar x:Name="Progressbar" Width="400" Height="25" Margin="47,38,47,14" Foreground="CadetBlue" BorderBrush="CadetBlue" BorderThickness="2"&gt;&lt;/ProgressBar&gt;
          &lt;/Grid&gt;
      &lt;/Grid&gt;
  &lt;/Border&gt;
  </code></pre>
  
  <p>
  <img src="https://i.stack.imgur.com/Bk7GR.png" alt="nk_Image_Converter.DynamicControls.ProgressBarWindow"></p>
  
  <p><strong>C#</strong></p>
  
  <pre><code>private void Window_ContentRendered(object sender, EventArgs e)
      {
          for(//Some Condition//)
          {
                Some Stuff
                Thread.sleep(100);
                this.ProgressBar.Value = //Some Value
                // above statement doesn't update the progressbar instantly
  
          }
      }
  </code></pre>
  
  <p>In the code above, I want the progress Bar to move as I give a Value every time
  inside for loop, but it gets updated when the event get completed. </p>