Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Suriman opened this issue Jul 8, 2022 · 1 comment · May be fixed by #181
Open

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

Suriman opened this issue Jul 8, 2022 · 1 comment · May be fixed by #181
Assignees

Comments

@Suriman
Copy link

Suriman commented Jul 8, 2022

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

@ajpinedam ajpinedam self-assigned this Jul 12, 2022
@ajpinedam
Copy link

Hi @Suriman Thanks for reporting this.

The issue on the Windows Head comes from the WindowsCommunityToolkit. since this is the library you are using in the references

For WASM and WPF, I will be validating why the converter is not finding the string and instead it returns an empty String.

@ajpinedam ajpinedam linked a pull request Jul 20, 2022 that will close this issue
11 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants