title: Implement progressbar in this simple WPF application
body: <p>I have MainWindow which has its viewmodel MainWindowViewModel. Inside the window there is one textbox which accepts the user's input and a few radio buttons to filter the search and one button. The button action is bound to the viewmodel using a command like:</p>
  
  <pre><code>&lt;Button x:Name="btnSearch" Command="{Binding SearchByCommand, Mode=OneWay}" /&gt;
  </code></pre>
  
  <p>Inside ViewModel there is:</p>
  
  <pre><code>public ICommand SearchByCommand
  {
      get
      {
          if (_SearchByCommand == null)
          {
              _SearchByCommand = new RelayCommand(
                  x =&gt; this.LoadData(this.SearchBy),
                  x =&gt; { return !string.IsNullOrEmpty(this.SearchText); }
              );
          }
          return _SearchByCommand;
      }
  }
  </code></pre>
  
  <p>And LoadData:</p>
  
  <pre><code>private void LoadData(string searchBy)
  {
     switch(searchBy)
     ...
  }
  </code></pre>
  
  <p>This works perfectly, but I don't know how to implement a progressbar in this solution. When the user clicks on the search button, the progressbar should start the progress and freeze the current UI. After loading data in the LoadData method the progressbar's progresscount should end and enable the UI again.</p>