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

Fix ResourceNameToResourceString converter #181

Open
wants to merge 1 commit into
base: uno
Choose a base branch
from

Conversation

ajpinedam
Copy link

Fixes #180

Using the ResourceNameToResourceString with key bound returns empty string.

PR Type

What kind of change does this PR introduce?

  • Bugfix

What is the current behavior?

Using the ResourceNameToResourceString with key bound returns empty string.

What is the new behavior?

Key in Resource file is returned when it does exist.

PR Checklist

Please check if your PR fulfills the following requirements:

  • Tested code with current supported SDKs
  • New component
    • Pull Request has been submitted to the documentation repository instructions. Link:
    • Added description of major feature to project description for NuGet package (4000 total character limit, so don't push entire description over that)
    • If control, added to Visual Studio Design project
  • Sample in sample app has been added / updated (for bug fixes / features)
  • New major technical changes in the toolkit have or will be added to the Wiki e.g. build changes, source generators, testing infrastructure, sample creation changes, etc...
  • Tests for the changes have been added (for bug fixes / features) (if applicable)
  • Header has been added to all new source files (run build/UpdateHeaders.bat)
  • Contains NO breaking changes

Other information

@@ -18,7 +18,7 @@ namespace CommunityToolkit.WinUI.UI.Converters
/// </summary>
public sealed class ResourceNameToResourceStringConverter : IValueConverter
{
private readonly ResourceLoader _resourceLoader = new ResourceLoader();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we should be fixing uno instead (there's an issue opened IIRC). If I recall properly, ResourceLoader.GetForViewIndependentUse(); is not available under WinAppSDK.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems it's available now. I checked the base repository implementation, and this is how they fixed it.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 this pull request may close these issues.

ResourceNameToResourceString converter does not find the resource altough it exists.
2 participants