3 ms·
Also notable, per the docs[1], If you try to show the file picker while your app is snapped the file picker will not be shown and an exception will be thrown.
by jasomill 4y ago
Also notable, per the docs[1],
If you try to show the file picker while your app is snapped the file picker will not be shown and an exception will be thrown. You can avoid this by making sure your app is not snapped or by unsnapping it before you call the file picker. The code examples in FileSavePicker and the File picker sample show you how.
The example on the linked FileSavePicker[2] page "shows you how" by presenting a sample excerpt that calls an "EnsureUnsnapped" method that is neither a part of any documented API nor defined in any version of the sample I can find in GitHub.
Wasting considerable time, I managed to dig up an older version of the sample[3], ca. March 2013, that matches the doc excerpt. As it turns out, "EnsureUnsnapped" is defined in terms of a "TryUnsnap" method[4] that is deprecated because "window snapping" in the sense used here apparently only applies to store apps running on Windows 8.1 and earlier — notably, this includes the still-supported Windows Server 2012 R2 — and must not be confused with the current feature also officially known as window snapping.
From this I assume this warning only applies to apps that need to work correctly on obsolete or nearly-obsolete versions of Windows, and it only took me the better part of an hour to figure this out.
One of my biggest gripes with Microsoft is their somewhat recent tendency to memory-hole online-exclusive documentation and related materials for older versions of Windows that some of us, by hook or crook, are required to at least occasionally support, because telling an important customer to fuck off because their otherwise functional, fully security-patched OS is no longer under "mainstream" Microsoft support is a great way to lose said customer.
Is either providing offline documentation or maintaining an online archive of older documentation really too much to ask? Given the time and effort Microsoft has clearly invested in redesigning their developer documentation site every few years, the effort required to do the latter seems like a drop in the bucket.
To provide an illustrative counterexample: I can still find pinouts for the ports on my 128K Macintosh[5] or helpful tips to ensure my desk accessory is compatible with Font/DA Mover[6] if I need them, even if the relevant pages haven't been restyled since the late '90s.
[1] https://learn.microsoft.com/en-us/uwp/api/windows.storage.pickers.filesavepicker.picksavefileasync https://learn.microsoft.com/en-us/uwp/api/windows.storage.pi...
[2] https://learn.microsoft.com/en-us/uwp/api/windows.storage.pickers.filesavepicker https://learn.microsoft.com/en-us/uwp/api/windows.storage.pi...
[3] https://web.archive.org/web/20130403000823/http://code.msdn.microsoft.com/windowsapps/File-picker-sample-9f294cba/file/43705/23/File%20picker%20sample.zip https://web.archive.org/web/20130403000823/http://code.msdn....
[4] https://learn.microsoft.com/en-us/uwp/api/windows.ui.viewmanagement.applicationview.tryunsnap https://learn.microsoft.com/en-us/uwp/api/windows.ui.viewman...
[5] https://developer.apple.com/library/archive/technotes/hw/hw_19.html#//apple_ref/doc/uid/DTS10002488 https://developer.apple.com/library/archive/technotes/hw/hw_...
[6] https://developer.apple.com/library/archive/technotes/pt/pt_19.html#//apple_ref/doc/uid/DTS10002673 https://developer.apple.com/library/archive/technotes/pt/pt_...