private FrameworkElement CreateMovingElement() { var pb = new ProgressBar(); pb.BeginInit(); pb.IsIndeterminate = true; pb.Width = 200; pb.Height = 100; pb.EndInit(); return(pb); }