private async void DumpButton_Click(object sender, RoutedEventArgs e) { await _captureManager.StopRecordAsync(); var data = new byte[_stream.Length]; await _stream.ReadAsync(data, 0, data.Length); var storageFolder = ApplicationData.Current.LocalFolder; var sampleFile = await storageFolder.CreateFileAsync("test.mp4", CreationCollisionOption.ReplaceExisting); await FileIO.WriteBytesAsync(sampleFile, data); }