Reputation: 6091
When you register your app as a file-save picker, you get a FileSavePickerActivatedEventArgs
in your App.xaml.cs:
protected override void OnFileSavePickerActivated(FileSavePickerActivatedEventArgs e)
{
var filter = e.FileSavePickerUI.AllowedFileTypes; // This is IReadOnlyList<string>
}
When the user selects a different set of file-types:
How will I get the notification that the collection changed? FileSavePickerUI.AllowedFileTypes
is not observable. Is there a trick?
@MethodMan, in Windows Store Apps you can register your app to be a FileSavePicker, which allows it to show up as an option when other apps want to "Save as...". The UI that contains your app is outside your control, like the drop down for "Save as type" (look at photo above). This drop down contains the values for FileSavePickerUI.AllowedFileTypes
. When the user changes this selection, I need to get a notification. Except... I can't. I can't seem to find any way to observe this change.
Looks like there's a bug in Windows 10 as of (Oct 2015) where the FileNameChanged
event does not fire when the type is changed. This only seems to work in Windows 8.
Upvotes: 0
Views: 61
Reputation: 12019
The FileNameChanged
event is documented as being raised whenever the file type changes.
Upvotes: 1