예제 #1
0
        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;
        }
예제 #2
0
        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();
                }
            });
        }