title: changing ellipse colour at runtime
body: <p>I have not used wpf alot and thought it would be a simple proccess to change the colour of an ellipse at runtime. I have a FileWatcher and in the event created I want to change the colour of the ellipse to a colour and back again, creating a blinking effect. (created is the ellipse, br4 is a solid colour brush defined in xaml)</p>
  
  <pre><code>    public void watcherCreated(object seneder, FileSystemEventArgs e)
      {
  
          Application.Current.Resources["br4"] = new SolidColorBrush(Colors.Green);
          created.Fill = (SolidColorBrush)Application.Current.Resources["br4"];
  
      }
  </code></pre>
  
  <p>as soon as a file is created in the path which fires the event i get this error: Invalid operation exception
  The calling thread cannot access this object because a different thread owns it.
  I have looked for a solution with the freeze() method, but with no success.</p>
  
  <pre><code>     created.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority.Normal, new Action(
              delegate()
              {
                  Application.Current.Resources["br4"] = new SolidColorBrush(Colors.Green);
                  created.Fill = (SolidColorBrush)Application.Current.Resources["br4"];
              }
          ));
  </code></pre>
  
  <p>got it thanks for comments</p>