public MainMenuViewModel(FrameWindowViewModel frameModel) { string[] arguments = Environment.GetCommandLineArgs(); if (arguments.Length > 2) { this.Name = arguments[1]; int.TryParse(arguments[2], out var points); this.Points = points; } _frameModel = frameModel; this.PlayButtonCommand = new RelayCommand(this.ChangeWindow); this.CloseButtonCommand = new RelayCommand(this.CloseWindow); this.Highscore = "HIGHSCORE: " + Convert.ToString(frameModel.Points); }
public IntroViewModel(FrameWindowViewModel frameWindow) { this._frameWindow = frameWindow; this.Width = SystemParameters.MaximizedPrimaryScreenWidth; this.Height = SystemParameters.MaximizedPrimaryScreenHeight; this.VideoSource = new Uri(@"..\..\Resources\Media\introvegas.wmv", UriKind.Relative); this.MediaElement = new MediaElement { Source = this.VideoSource, Height = this.Height, Width = this.Width, SpeedRatio = 1.12, LoadedBehavior = MediaState.Manual }; this.MediaElement.MediaEnded += IntroEndedEventHandler; this.Activated += StartIntro; }
public PlayViewModel(FrameWindowViewModel frameWindow) { _frameViewModel = frameWindow; ImageBrush backgroundImage = new ImageBrush(); string imagePath = @"../../Resources/Images/IngameBackground.jpg"; var imageBitmap = new BitmapImage(new Uri(imagePath, UriKind.Relative)); backgroundImage.ImageSource = imageBitmap; double canvasHeight = this._frameViewModel.Height - 164; double canvasWidth = this._frameViewModel.Width / 2.55; AnimatedObject.CanvasHeight = canvasHeight; this.Canvas = new Canvas() { Height = canvasHeight, Width = canvasWidth, Focusable = true, Background = backgroundImage }; this.Activated += this.StartGameEventHandler; }