public MainPage() { InitializeComponent(); _invadersViewModel = FindResource(nameof(InvadersViewModel)) as InvadersViewModel; InvadersHelper.BringToFront(GameOverText); InvadersHelper.BringToFront(PausedText); }
public void TestRecreateScanLines() { InvadersViewModel viewModel = new InvadersViewModel(); int oldScanLines = viewModel.ScanLines.Count; viewModel.RecreateScanLines(); int newScanLines = viewModel.ScanLines.Count; Assert.AreNotEqual(oldScanLines, newScanLines, "Should not be equal. \"newScanLines\" should contain Scan Lines."); }
public InvadersWindow() { InitializeComponent(); viewModel = FindResource("viewModel") as InvadersViewModel; double cornerRadius = 10; playArea.CornerRadius = new CornerRadius(cornerRadius); playArea.Padding = new Thickness(cornerRadius * (1 - Math.Cos(Math.PI / 4))); }
public MainWindow() { InitializeComponent(); var viewModel = Resources["ViewModel"] as InvadersViewModel; if (viewModel != null) { _viewModel = viewModel; } _viewModel.NextWaveGenerated += ViewModelNextWaveGeneratedEventHandler; _viewModel.GameLost += ViewModelGameLostEventHandler; _viewModel.PlayerShot += ViewModelPlayerShotEventHandler; }
public InvadersView() { InitializeComponent(); viewModel = FindResource("viewModel") as InvadersViewModel; }