private void PongControl_Loaded(object sender, RoutedEventArgs e) { model = new PongModel(); logic = new PongLogic(model); renderer = new PongRenderer(model); Window wnd = Window.GetWindow(this); if (wnd != null) { tickTimer = new DispatcherTimer(); tickTimer.Interval = TimeSpan.FromMilliseconds(40); tickTimer.Tick += TickTimer_Tick; tickTimer.Start(); wnd.KeyDown += Wnd_KeyDown; this.MouseLeftButtonDown += PongControl_MouseLeftButtonDown; } logic.RefreshScreen += (s, e) => InvalidateVisual(); InvalidateVisual(); }
public PongLogic(PongModel model) { this.model = model; }
public PongRenderer(PongModel model) { this.model = model; }