StorageLibrary.AreFolderSuggestionsAvailableAsync 메서드

정의

StorageLibrary에 콘텐츠가 포함된 기존 폴더를 추가하기 위한 제안이 있는지 확인합니다.

public:
 virtual IAsyncOperation<bool> ^ AreFolderSuggestionsAvailableAsync() = AreFolderSuggestionsAvailableAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<bool> AreFolderSuggestionsAvailableAsync();
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<bool> AreFolderSuggestionsAvailableAsync();
function areFolderSuggestionsAvailableAsync()
Public Function AreFolderSuggestionsAvailableAsync () As IAsyncOperation(Of Boolean)

반환

True 이면 폴더 제안이 있습니다. False 이면

특성

Windows 요구 사항

디바이스 패밀리
Windows 10 Fall Creators Update (10.0.16299.0에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v5.0에서 도입되었습니다.)

예제

이 예제에서는 사진 라이브러리에 추가할 수 있는 콘텐츠가 포함된 제안된 폴더가 있는지 여부를 확인하는 방법을 보여 줍니다.

private async Task<StorageLibrary> SetupPicturesLibraryAsync()
{
    if (this.picturesLibrary == null)
    {
        this.picturesLibrary = await StorageLibrary.GetLibraryAsync(KnownLibraryId.Pictures);
        this.picturesLibrary.DefinitionChanged += PicturesLibrary_DefinitionChanged;
    }
    return this.picturesLibrary;
}

private async void CheckForFolderSuggestions_Clicked(object sender, RoutedEventArgs e)
{
    var library = await SetupPicturesLibraryAsync();

    if (await library.AreFolderSuggestionsAvailableAsync())
    {
        // There are new folders that could be added to the library.
        // Prompt the user to add one or more of them. 

        // Note that the RequestAddFolderAsync method returns only one folder.
        // If the user adds multiple folders, only one will be returned.
        // In this example, to keep track of all the added folders, the app can subscribe to the
        // StorageLibrary.DefinitionChanged event by awaiting library.RequestAddFolderAsync();

        // Launch the folder suggestion dialog
        var folder = await library.RequestAddFolderAsync(); 
    }
}

private void PicturesLibrary_DefinitionChanged(StorageLibrary sender, object args)
{
    foreach (StorageFolder folder in sender.Folders)
    {
        // Do something with every folder in the library
    }
}

참고

앱의 패키지 매니페스트에 picturesLibrary 기능을 포함해야 합니다. 매니페스트의 기능에 대한 자세한 내용은 앱 기능 선언을 참조하세요.

설명

이 기능이 Windows 버전에서 지원되지 않는 경우 메서드는 false를 반환합니다.

적용 대상