Share via


CachedFileUpdaterUI 클래스

정의

앱이 캐시된 파일 업데이트 프로그램 계약을 통해 파일 업데이트를 제공하는 경우 파일 선택기와 상호 작용하는 데 사용됩니다.

public ref class CachedFileUpdaterUI sealed
/// [Windows.Foundation.Metadata.ContractVersion(Windows.Foundation.UniversalApiContract, 65536)]
class CachedFileUpdaterUI final
[Windows.Foundation.Metadata.ContractVersion(typeof(Windows.Foundation.UniversalApiContract), 65536)]
public sealed class CachedFileUpdaterUI
Public NotInheritable Class CachedFileUpdaterUI
상속
Object Platform::Object IInspectable CachedFileUpdaterUI
특성

Windows 요구 사항

디바이스 패밀리
Windows 10 (10.0.10240.0 - for Xbox, see UWP features that aren't yet supported on Xbox에서 도입되었습니다.)
API contract
Windows.Foundation.UniversalApiContract (v1.0에서 도입되었습니다.)

예제

파일 선택기 계약 샘플에서는 CachedFileUpdater 활성화 이벤트에 응답하는 방법을 보여 줍니다.

// CachedFileUpdater activated event handler
protected override void OnCachedFileUpdaterActivated(CachedFileUpdaterActivatedEventArgs args)
{
    var CachedFileUpdaterPage = new SDKTemplate.CachedFileUpdaterPage();
    CachedFileUpdaterPage.Activate(args);
}

// Overloaded method to respond to CachedFileUpdater events
public void Activate(CachedFileUpdaterActivatedEventArgs args)
{
            // Get file picker UI
            cachedFileUpdaterUI = args.CachedFileUpdaterUI;

            cachedFileUpdaterUI.FileUpdateRequested += CachedFileUpdaterUI_FileUpdateRequested;
            cachedFileUpdaterUI.UIRequested += CachedFileUpdaterUI_UIRequested;

            switch (cachedFileUpdaterUI.UpdateTarget)
            {
                case CachedFileTarget.Local:
                    scenarios = new List<Scenario> { new Scenario() { Title = "Get latest version", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Local) } };
                    break;
                case CachedFileTarget.Remote:
                    scenarios = new List<Scenario> { new Scenario() { Title = "Remote file update", ClassType = typeof(FilePickerContracts.CachedFileUpdater_Remote) } };
                    break;
            }

            Window.Current.Activate();
        }

C# args 의 경우 CachedFileUpdaterActivatedEventArgs 개체를 포함합니다. 또한 는 OnCachedFileUpdaterActivated App.xaml.cs 파일에 있고 Activate 메서드는 파일 선택기 계약 샘플의 CachedFileUpdaterPage.xaml.cs 파일에 있습니다.

설명

CachedFileUpdaterActivatedEventArgs.CachedFileUpdaterUI 속성을 사용하여 CachedFileUpdaterUI 개체를 검색합니다.

속성

Title

파일 선택기 UI의 왼쪽 위에 표시할 제목을 가져오거나 설정합니다. 타이틀은 사용자의 앱 페이지(파일 선택기 UI에서 호스트됨)의 위치 또는 컨텍스트를 식별합니다.

UIStatus

파일 선택기 UI의 상태 나타내는 열거형 값을 가져옵니다.

UpdateRequest

캐시된 파일 업데이트에서 현재 처리 중인 파일 업데이트 요청을 가져옵니다.

UpdateTarget

업데이트해야 하는 파일 버전(로컬 버전 또는 앱 리포지토리의 버전)을 나타내는 값을 가져옵니다.

메서드

GetDeferral()

파일 업데이트 요청을 비동기적으로 완료하는 데 사용되는 개체를 가져옵니다.

이벤트

FileUpdateRequested

Windows에서 파일 업데이트를 요청할 때 발생합니다. 이 이벤트는 요청된 각 업데이트에 대해 한 번 발생합니다.

UIRequested

호출 앱이 CachedFileUpdaterUI 개체로 표시되는 파일 선택 레터박스 UI를 표시해야 할 때 발생합니다.

서버는 이 이벤트를 받을 때까지 UI 초기화를 연기할 수 있습니다.

적용 대상

추가 정보