public async Task GetRecordScreens(Record record) { RingContentVisibility = true; using (var db = new PrototypingContext()) { RecordModel = db.Records.Single(r => r.RecordId == record.RecordId); await db.Entry(RecordModel).Collection(r => r.Screens).LoadAsync(); if (!string.IsNullOrEmpty(RecordModel.PathToVideo)) { StorageFile videoFile = await StorageFile.GetFileFromPathAsync(RecordModel.PathToVideo); Windows.UI.Xaml.Controls.MediaPlayerElement player = new Windows.UI.Xaml.Controls.MediaPlayerElement(); player.AreTransportControlsEnabled = true; player.Source = MediaSource.CreateFromStorageFile(videoFile); RecordVideo = player; VideoIconVisibility = true; } else { VideoIconVisibility = false; } Screens = await FileToImageTransform(RecordModel.Screens); } RingContentVisibility = false; }
public async Task HeatSaveScreens(List <RecordScreenModel> reviewModels) { RingContentVisibility = true; using (var db = new PrototypingContext()) { RecordModel = db.Records.Last(); if (!string.IsNullOrEmpty(RecordModel.PathToVideo)) { StorageFile videoFile = await StorageFile.GetFileFromPathAsync(RecordModel.PathToVideo); await Task.Delay(1000); Windows.UI.Xaml.Controls.MediaPlayerElement player = new Windows.UI.Xaml.Controls.MediaPlayerElement(); player.AreTransportControlsEnabled = true; player.Source = MediaSource.CreateFromStorageFile(videoFile); RecordVideo = player; VideoIconVisibility = true; } else { VideoIconVisibility = false; } } Screens = await HeatingScreens(reviewModels); RingContentVisibility = false; }