public async Task CreateFromAsync(string plotDataFilePath) { LastUsedPath = plotDataFilePath; xmlFileManager.FileName = plotDataFilePath; TestResult = await xmlFileManager.Get <HearingTestResult>(); Update(); }
protected async override void OnActivate() { fileManager.FileName = ResultFileName; var results = await fileManager.Get <HearingTestResult>(); Description = results.Description; var source = results.LeftChannel.Select(x => new DataItem { Channel = Channel.Left, Frequency = x.Frequency, Volume = x.Volume }) .Concat(results.RightChannel.Select(x => new DataItem { Channel = Channel.Right, Frequency = x.Frequency, Volume = x.Volume })); Items = Group.CreateGroups(source, item => item.Channel).ToList(); }
protected async override void OnActivate() { IsBusy = true; ResultFiles.Clear(); var files = await storageFolder.GetFilesAsync(); var resultFiles = files.Where(x => x.Name.EndsWith(".result", StringComparison.OrdinalIgnoreCase)).ToList(); foreach (var storageFile in resultFiles) { var modificationDate = (await storageFile.GetBasicPropertiesAsync()).DateModified; fileManager.FileName = storageFile.Name; var testResult = await fileManager.Get <HearingTestResult>(); ResultFiles.Add(new ResultFileViewModel { CreationDate = storageFile.DateCreated.DateTime, LastChangedDate = modificationDate.DateTime, FileName = storageFile.Name, Description = testResult.Description }); } IsBusy = false; }