private async void AddFolderList_OnItemClickAsync(object sender, ItemClickEventArgs e) { var folderPicker = new FolderPicker { SuggestedStartLocation = PickerLocationId.PicturesLibrary }; folderPicker.FileTypeFilter.Add("*"); var storageFolder = await folderPicker.PickSingleFolderAsync(); if (storageFolder == null) { return; } await DispatcherHelper.ExecuteOnUIThreadAsync(() => { _viewModel.AddFolder(storageFolder); }); _ifContentChanged = true; }
private async void AddFolderButton_OnClickAsync(object sender, RoutedEventArgs e) { var folderPicker = new FolderPicker { SuggestedStartLocation = PickerLocationId.PicturesLibrary }; folderPicker.FileTypeFilter.Add("*"); var storageFolder = await folderPicker.PickSingleFolderAsync(); if (storageFolder == null) { return; } await DispatcherHelper.ExecuteOnUIThreadAsync(() => { _settingsViewModel.AddFolder(storageFolder); using (var scope = App.Container.BeginLifetimeScope()) { scope.Resolve <IScanImageTask>().Start(); } }); }