public BallTimerForm()
 {
     this.rand = new Random();
     this.frame = new Frame(this.rand);
     this.ballFactory = new BallFactory(this.rand, this.frame);
     this.InitializeComponent();
     this.initPicture();
 }
 private void Window_Loaded(object sender, RoutedEventArgs e)
 {
     this.frame = new AppFrame(this.rand, this.canvas.ActualWidth, this.canvas.ActualHeight);
     this.ballFactory = new BallFactory(this.rand, this.frame);
     this.canvas.Children.Add(this.frame.getRect());
 }