When i try to do this:
folderPicker = new FolderPicker();
folderPicker.SuggestedStartLocation = PickerLocationId.Desktop;
folderPicker.FileTypeFilter.Add(".txt");
StorageFolder folder = await folderPicker.PickSingleFolderAsync();
it show me error:
Error 2 The 'await' operator can only be used within an async method. Consider marking this method with the 'async' modifier and changing its return type to 'Task'. C:\Users\Lukasz\Documents\Visual Studio 2012\Projects\RobimyProjekt\RobimyProjekt\ImageBrowser.xaml.cs.
When i deleted "await" it show me another error:
Error 2 Cannot implicitly convert type 'Windows.Foundation.IAsyncOperation' to 'Windows.Storage.StorageFolder' C:\Users\Lukasz\Documents\Visual Studio 2012\Projects\RobimyProjekt\RobimyProjekt\ImageBrowser.xaml.cs 61 36 RobimyProjekt.
What's going on? That code is from msdna and i using Visual Studio 2012.
change it to