Share via


XamlResourceReferenceFailedEventArgs.Message 속성

정의

XAML 리소스 참조 실패에 대한 사람이 읽을 수 있는 설명(영어로)을 가져옵니다.

public:
 property Platform::String ^ Message { Platform::String ^ get(); };
winrt::hstring Message();
public string Message { get; }
var string = xamlResourceReferenceFailedEventArgs.message;
Public ReadOnly Property Message As String

속성 값

String

Platform::String

winrt::hstring

XAML 리소스 참조 실패에 대한 사람이 읽을 수 있는 설명(영어로)입니다.

예제

다음은 잘못된 리소스 참조(가 아닌OutputTextBlockStyle)OutputTextBlockStyl가 의도적으로 삽입된 후 WinUI 갤러리 샘플 앱의 예제 메시지입니다. 원하는 리소스가 에 App.xaml정의되어 있다는 것을 알고 있는 경우 에서 리소스를 찾지 못하면 잘못된 참조에 대한 강력한 지표가 있습니다.

주의

이 예제 출력은 설명용으로만 사용됩니다. 메시지의 정확한 형식은 구현에서 정의되며 나중에 변경될 수 있습니다. 애플리케이션은 메시지를 구문 분석하려고 시도해서는 안 됩니다.

Beginning search for resource with key 'OutputTextBlockStyl'.
  Searching dictionary 'ms-appx:///Controls/ControlExample.xaml' for resource with key 'OutputTextBlockStyl'.
  Finished searching dictionary 'ms-appx:///Controls/ControlExample.xaml'.
  Searching dictionary 'Framework-defined colors' for resource with key 'OutputTextBlockStyl'.
  Finished searching dictionary 'Framework-defined colors'.
  Searching dictionary 'Framework ThemeResources.xbf' for resource with key 'OutputTextBlockStyl'.
    Searching theme dictionary (active theme: 'Light') for resource with key 'OutputTextBlockStyl'.
      Searching dictionary '<anonymous dictionary>' for resource with key 'OutputTextBlockStyl'.
      Finished searching dictionary '<anonymous dictionary>'.
    Finished searching theme dictionary (active theme: 'Light').
  Finished searching dictionary 'Framework ThemeResources.xbf'.
  Searching dictionary 'ms-appx:///App.xaml' for resource with key 'OutputTextBlockStyl'.
    Searching merged dictionary with index '1' for resource with key 'OutputTextBlockStyl'.
      Searching dictionary 'ms-appx:///Microsoft.UI.Xaml/Themes/themeresources.xaml' for resource with key 'OutputTextBlockStyl'.
        Searching theme dictionary (active theme: 'Light') for resource with key 'OutputTextBlockStyl'.
          Searching dictionary 'ms-appx:///Microsoft.UI.Xaml/Themes/themeresources.xaml' for resource with key 'OutputTextBlockStyl'.
          Finished searching dictionary 'ms-appx:///Microsoft.UI.Xaml/Themes/themeresources.xaml'.
        Finished searching theme dictionary (active theme: 'Light').
      Finished searching dictionary 'ms-appx:///Microsoft.UI.Xaml/Themes/themeresources.xaml'.
    Finished searching merged dictionary with index '1'.
    Searching merged dictionary with index '0' for resource with key 'OutputTextBlockStyl'.
      Searching dictionary 'ms-appx:///ItemTemplates.xaml' for resource with key 'OutputTextBlockStyl'.
      Finished searching dictionary 'ms-appx:///ItemTemplates.xaml'.
    Finished searching merged dictionary with index '0'.
    Searching theme dictionary (active theme: 'Light') for resource with key 'OutputTextBlockStyl'.
      Searching dictionary 'ms-appx:///App.xaml' for resource with key 'OutputTextBlockStyl'.
      Finished searching dictionary 'ms-appx:///App.xaml'.
    Finished searching theme dictionary (active theme: 'Light').
  Finished searching dictionary 'ms-appx:///App.xaml'.
Finished search for resource with key 'OutputTextBlockStyl'.

설명

이벤트 데이터의 메시지에는 실패한 XAML 리소스 참조에 대한 다음 정보가 포함됩니다.

  • 검색된 각 ResourceDictionary 가 포함된 XAML 페이지의 URI입니다.
  • 가 검색된 순서 ResourceDictionary입니다.

이 정보를 사용하여 XAML 리소스 참조를 확인할 수 없는 이유를 조사할 수 있습니다. 예를 들어 ResourceDictionary 리소스가 포함된 가 검색된 ResourceDictionaryResourceDictionary목록에 없거나 검색된 것일 수 있습니다. 이는 잘못된 리소스 키가 지정되었음을 나타낼 수 있습니다.

적용 대상

추가 정보