I get the following exception when I try to get information about the color in Rectangle element: [WPF Extension Error] Details: System.InvalidOperationException: The calling thread cannot access this object because a different thread owns it. I am using this code: var rect = app.MainWindow.Find.AllByType<Rectangle>(); var brush = rect[0].Fill as LinearGradientBrush; var color = brush.GradientStops[0].Color; //here the exception is thrown