/// <summary> /// Playback an image. /// </summary> private void PlaybackImage(Guid pictureId) { var filenameResolver = this.CreateFilenameResolver(pictureId); var pictureIOManager = new PictureIOManager(filenameResolver); ImageStateData imageStateData = pictureIOManager.LoadImageStateData(); this.SetOrientationForImage(imageStateData); var canvasPlayback = new CanvasPlayback(filenameResolver.MasterCanvasRecorderFilename(imageStateData.CurrentSavePoint)); this.SetOrientationForImage(imageStateData); // Simply instantiate the class derived from monogame:game and away we go... ToolboxLayoutDefinition layoutDefinition = imageStateData.Width > imageStateData.Height ? this.toolboxLayoutManager.PlaybackLandscapeToolboxLayout : this.toolboxLayoutManager.PlaybackPortraitToolboxLayout; this.playBackApp = new CanvasPlaybackApp(canvasPlayback, imageStateData, layoutDefinition, this.deviceScale); this.playBackApp.Exiting += CanvasPlaybackAppExiting; this.playBackApp.Run(); }
/// <summary> /// Called once the 'playback app' has exited. /// </summary> /// <param name='sender'>Sender</param> /// <param name='e'>Any relevant event args </param> private void CanvasPlaybackAppExiting(object sender, EventArgs e) { if (this.playBackApp != null) { this.playBackApp.Exiting -= CanvasPlaybackAppExiting; this.playBackApp.Dispose(); this.playBackApp = null; } this.window.MakeKeyAndVisible(); }