@@ -635,11 +635,9 @@ internal async void ExportSelectedToCSV()
635
635
return ;
636
636
}
637
637
638
- #if WINDOWS
639
638
try
640
639
{
641
- var hWnd = Win32Interop . GetWindowFromWindowId ( XamlRoot . ContentIslandEnvironment . AppWindowId ) ;
642
- if ( await GetStorageFile ( hWnd ) is not { } file )
640
+ if ( await GetStorageFile ( ) is not { } file )
643
641
{
644
642
return ;
645
643
}
@@ -652,9 +650,6 @@ internal async void ExportSelectedToCSV()
652
650
await tw . WriteAsync ( content ) ;
653
651
}
654
652
catch { }
655
- #else
656
- await Task . CompletedTask ;
657
- #endif
658
653
}
659
654
660
655
/// <summary>
@@ -679,11 +674,9 @@ internal async void ExportAllToCSV()
679
674
return ;
680
675
}
681
676
682
- #if WINDOWS
683
677
try
684
678
{
685
- var hWnd = Win32Interop . GetWindowFromWindowId ( XamlRoot . ContentIslandEnvironment . AppWindowId ) ;
686
- if ( await GetStorageFile ( hWnd ) is not { } file )
679
+ if ( await GetStorageFile ( ) is not { } file )
687
680
{
688
681
return ;
689
682
}
@@ -696,9 +689,6 @@ internal async void ExportAllToCSV()
696
689
await tw . WriteAsync ( content ) ;
697
690
}
698
691
catch { }
699
- #else
700
- await Task . CompletedTask ;
701
- #endif
702
692
}
703
693
704
694
/// <summary>
@@ -713,11 +703,14 @@ protected virtual void OnExportAllContent(TableViewExportContentEventArgs args)
713
703
/// <summary>
714
704
/// Gets a storage file for saving the CSV.
715
705
/// </summary>
716
- private static async Task < StorageFile > GetStorageFile ( IntPtr hWnd )
706
+ private async Task < StorageFile > GetStorageFile ( )
717
707
{
718
708
var savePicker = new FileSavePicker ( ) ;
719
- InitializeWithWindow . Initialize ( savePicker , hWnd ) ;
720
709
savePicker . FileTypeChoices . Add ( "CSV (Comma delimited)" , [ ".csv" ] ) ;
710
+ #if WINDOWS
711
+ var hWnd = Win32Interop . GetWindowFromWindowId ( XamlRoot . ContentIslandEnvironment . AppWindowId ) ;
712
+ InitializeWithWindow . Initialize ( savePicker , hWnd ) ;
713
+ #endif
721
714
722
715
return await savePicker . PickSaveFileAsync ( ) ;
723
716
}
0 commit comments