Skip to content

ResourceNameToResourceString converter does not find the resource altough it exists. #180

Open
@Suriman

Description

@Suriman

Describe the bug

Using the converter to obtain a named resource provokes a NullReferenceException in WindowsCommunityToolkit and an empty string in the Uno.WindowsCommunityToolkit.

Steps to Reproduce

Launch the attached solution in Windows head, a NullReferenceException should be thrown after MainPage.InitializeComponent() is executed. If the xaml with the Converter is commented it does not throw.
Launch the attached solution in WPF/Wasm head, a TextBlock with "Hello World", should be seen. The TextBlock which is using the Converter shows an empty string..

The resource is defined in Strings/en/Resources.resw and the same resource name is in a property of the code-behind of MainPage.xaml and x:binded to the Text property of the TextBlock.

Expected behavior

No error should be produced and the string resource should be set to the TextBlock.

Environment

NuGet package(s): Uno.WinUI Uno.WinUI 4.4.13, CommunityToolkit.WinUI.UI 7.1.2, Uno.CommunityToolkit.WinUI.UI 7.1.100-dev.15.g12261e2626

OS:
Windows 11 21H2 22000.739

IDE:
Visual Studio 2022

IDE version:
17.3.0 preview 2

Additional context

See the attached file.
ResourceNameToResourceStringConverterIssue.zip

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions