Skip to content

Commit 9127f51

Browse files
Fix FilePicker sample code (#1429)
## Description Corrects the `FilePicker` sample code modified by #1396.
1 parent 91c0044 commit 9127f51

File tree

5 files changed

+5
-5
lines changed

5 files changed

+5
-5
lines changed

WinUIGallery/ControlPagesSampleCode/System/FilePickerSample1_cs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
88

99
// See the sample code below for how to make the window accessible from the App class.
10-
var window = App.Window;
10+
var window = App.MainWindow;
1111

1212
// Retrieve the window handle (HWND) of the current WinUI 3 window.
1313
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(window);

WinUIGallery/ControlPagesSampleCode/System/FilePickerSample2_cs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
88

99
// See the sample code below for how to make the window accessible from the App class.
10-
var window = App.Window;
10+
var window = App.MainWindow;
1111

1212
// Retrieve the window handle (HWND) of the current WinUI 3 window.
1313
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(window);

WinUIGallery/ControlPagesSampleCode/System/FilePickerSample3_cs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
var openPicker = new Windows.Storage.Pickers.FileOpenPicker();
88

99
// See the sample code below for how to make the window accessible from the App class.
10-
var window = App.Window;
10+
var window = App.MainWindow;
1111

1212
// Retrieve the window handle (HWND) of the current WinUI 3 window.
1313
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(window);

WinUIGallery/ControlPagesSampleCode/System/FilePickerSample4_cs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
FolderPicker openPicker = new Windows.Storage.Pickers.FolderPicker();
88

99
// See the sample code below for how to make the window accessible from the App class.
10-
var window = App.Window;
10+
var window = App.MainWindow;
1111

1212
// Retrieve the window handle (HWND) of the current WinUI 3 window.
1313
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(window);

WinUIGallery/ControlPagesSampleCode/System/FilePickerSample5_cs.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
FileSavePicker savePicker = new Windows.Storage.Pickers.FileSavePicker();
88

99
// See the sample code below for how to make the window accessible from the App class.
10-
var window = App.Window;
10+
var window = App.MainWindow;
1111

1212
// Retrieve the window handle (HWND) of the current WinUI 3 window.
1313
var hWnd = WinRT.Interop.WindowNative.GetWindowHandle(window);

0 commit comments

Comments
 (0)