コード例 #1
0
        // This method fixes a FileSavePicker by first grabbing
        // the singleton MainWindow's WindowHandle, then call's
        // the FileSavePicker's Initialize method (from the Win32
        // API), passing in the WindowHandle, fixing the save
        // picker.
        public static void FixPicker(FileSavePicker filePicker)
        {
            // Get the Window's HWND
            var hwnd = Instance.As <IWindowNative>().WindowHandle;

            // Stop the folder picker from crashing
            // when prompted to pick a file.
            var initializeWithWindow = filePicker.As <IInitializeWithWindow>();

            initializeWithWindow.Initialize(hwnd);
        }