Compartir a través de


XamlResourceReferenceFailedEventArgs.Message Propiedad

Definición

Obtiene una descripción legible (en inglés) del error de referencia de recursos 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

Valor de propiedad

String

Platform::String

winrt::hstring

Descripción legible (en inglés) del error de referencia de recursos XAML.

Ejemplos

Este es un mensaje de ejemplo de la aplicación de ejemplo galería de WinUI después de insertar deliberadamente una referencia de recursos incorrecta (OutputTextBlockStyl en lugar de OutputTextBlockStyle). Si sabe que el recurso deseado se define en App.xaml, el error de localizarlo en hay un indicador seguro de una referencia errónea.

Precaución

Esta salida de ejemplo es solo para fines ilustrativos. El formato preciso del mensaje está definido por la implementación y puede cambiar en el futuro. Las aplicaciones no deben intentar analizar el mensaje.

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'.

Comentarios

El mensaje de los datos del evento contiene la siguiente información sobre la referencia de recursos XAML con errores:

  • URI de la página XAML que contiene cada ResourceDictionary que se ha buscado.
  • Orden en el que se buscaron los ResourceDictionaryelementos.

Puedes usar esta información para investigar por qué no se pudo resolver la referencia de recursos XAML. Por ejemplo, quizás el ResourceDictionary que contiene el recurso no estaba en la lista de ResourceDictionarys en la que se ha buscado; o quizás se ResourceDictionary haya buscado, lo que podría indicar que se especificó una clave de recurso incorrecta.

Se aplica a

Consulte también