title: The method when I click on a WPF button doesn't run well
body: <p>This is my XAML part code:</p>
  
  <pre><code>&lt;DockPanel Margin="1 5 1 0" Height="25"&gt;
      &lt;Button DockPanel.Dock="Right" Width="70" Margin="6 0 0 0" Content="Install" Click="Install" /&gt;
      &lt;Button DockPanel.Dock="Right" Width="70" Margin="6 0 0 0" Content="Uninstall"/&gt;
      &lt;ProgressBar Name="progressBar"/&gt;
  &lt;/DockPanel&gt;
  </code></pre>
  
  <p>And this is the Install method:</p>
  
  <pre><code>private void Install(object sender, RoutedEventArgs e)
  {
      progressBar.Value = 5;
  
      installer.InstallProgram1();
  
      progressBar.Value = 25;
  
      installer.InstallProgram2();
  
      progressBar.Value = 50;
  
      installer.InstallProgram3();
  
      progressBar.Value = 75;
  
      installer.InstallProgram4();
  
      progressBar.Value = 100;
  }
  </code></pre>
  
  <p>When I click the install button, it runs the Install method but not correctly.<br>
  - It never executes the first line: 'progressBar.Value = 5'.<br>
  - The second line works well.<br>
  - And after nothing works.  </p>
  
  <p>I tried to replace my method with 'MessageBox.Show("Hello World")', it works, the progress bar value changes.</p>
  
  <p>But why it doesn't work with my methods?<br>
  Why 'installer.InstallProgram2()' doesn't work/finish?</p>
  
  <p>My two methods, they are inside a Installer.cs file:</p>
  
  <pre><code>public void InstallProgram1()
  {
      // Download the lavfilters executable.
      var url = "http://www.videohelp.com/software/LAV-Filters";
      var selector = "a.linktool:nth-child(12)";
      var filename = downloader.DownloadFromVideoHelp(url, selector);
  
      // TODO: Installation
  }
  
  public void InstallProgram2()
  {
      // Download the madVR archive
      var url = "http://www.videohelp.com/software/madVR";
      var selector = ".linktool";
      var filename = downloader.DownloadFromVideoHelp(url, selector);
  
      // TODO: Installation
  }
  </code></pre>