DebugSettings 클래스

정의

앱이 디버그 환경에서 실행되면 앱의 특정 측면이 작동하는 방식을 선언합니다.

public ref class DebugSettings sealed
/// [Windows.Foundation.Metadata.ContractVersion(Microsoft.UI.Xaml.WinUIContract, 65536)]
/// [Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
class DebugSettings final
[Windows.Foundation.Metadata.ContractVersion(typeof(Microsoft.UI.Xaml.WinUIContract), 65536)]
[Windows.Foundation.Metadata.MarshalingBehavior(Windows.Foundation.Metadata.MarshalingType.Agile)]
public sealed class DebugSettings
Public NotInheritable Class DebugSettings
상속
Object Platform::Object IInspectable DebugSettings
특성

예제

이 예제에서는 Application.DebugSettings에 액세스하고 singleton DebugSettingstrue의 두 속성을 로 설정하는 OnLaunched 재정의를 보여 줍니다. 이 코드의 컨텍스트는 app.xaml 코드 숨김이므로 this 앱에 대해 생성된 Application 개체를 참조합니다.

protected override void OnLaunched(LaunchActivatedEventArgs args) {
    this.DebugSettings.EnableFrameRateCounter = true;
    this.DebugSettings.IsOverdrawHeatMapEnabled = true;
    //...
}

설명

이 클래스는 생성할 수 없습니다. Application.DebugSettings에서 값을 가져와서 필요에 따라 속성을 변경합니다.

OnLaunched 는 DebugSettings 값을 변경하기에 좋은 위치입니다.

DebugSettings에서 사용하도록 설정된 모든 모드에서 디버거를 연결해야 하는 것은 아닙니다. 예를 들어 EnableFrameRateCounter 와 연결된 프레임 속도 카운터는 디버거 없이 타일로 활성화하더라도 해당 설정으로 실행되는 앱에 표시됩니다.

프로덕션 코드에 명시적으로 설정된 DebugSettings 속성을 그대로 두지 마세요.

속성

EnableFrameRateCounter

프레임 속도 및 프레임당 CPU 사용량 정보를 표시할지 여부를 나타내는 값을 가져오거나 설정합니다. 앱이 실행되는 동안 창 크롬에 카운터 오버레이로 표시됩니다.

FailFastOnErrors

XAML 오류로 인해 오류를 반환하는 대신 즉시 FailFast가 발생하는지 여부를 나타내는 값을 가져오거나 설정합니다.

IsBindingTracingEnabled

앱이 실행되면 Microsoft Visual Studio의 바인딩 추적 기능을 사용할지 여부를 나타내는 값을 가져오거나 설정합니다. 연결되고 바인딩 오류가 발생하면 BindingFailed 이벤트가 발생하고 오류 정보가 네이티브 디버그 출력에 기록됩니다.

IsTextPerformanceVisualizationEnabled

앱이 실행되면 Microsoft Visual Studio의 텍스트 성능 시각화 기능을 사용할지 여부를 나타내는 값을 가져오거나 설정합니다.

IsXamlResourceReferenceTracingEnabled

앱이 실행되면 Microsoft Visual Studio의 XAML 리소스 참조 추적 기능을 사용할지 여부를 나타내는 값을 가져오거나 설정합니다. 연결되고 XAML 리소스 참조 오류가 발생하면 XamlResourceReferenceFailed 이벤트가 발생하고 오류 정보가 네이티브 디버그 출력에 기록됩니다.

LayoutCycleDebugBreakLevel

디버거 중단점을 트리거하는 레이아웃 주기 추적 이벤트의 수준을 나타내는 값을 가져오거나 설정합니다.

LayoutCycleTracingLevel

레이아웃 주기 추적이 네이티브 디버거에 기록되는지 여부와 기록되는 세부 정보 수준을 나타내는 값을 가져오거나 설정합니다.

이벤트

BindingFailed

바인딩을 확인할 수 없는 경우에 발생합니다.

XamlResourceReferenceFailed

XAML 리소스에 대한 참조를 확인할 수 없는 경우에 발생합니다.

적용 대상

추가 정보