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

MergeResourceInclude Not Mentioned In Docs; ResourceInclude Example Not Working #521

Open
scarryaa opened this issue Jul 19, 2024 · 1 comment

Comments

@scarryaa
Copy link

Hi, I may have found a slight issue with the docs. Apologies if this has been reported before or is a non-issue, but I couldn't find it already mentioned when I searched.

The issue is on this page, under Include and merge resources:
https://docs.avaloniaui.net/docs/guides/styles-and-resources/resources#include-and-merge-resources

The docs mention how to set up a separate Resource File and include it:

<Styles.Resources>
    <ResourceDictionary>
      <ResourceDictionary.MergedDictionaries>
        <ResourceInclude Source="/Assets/AppResources.axaml"/>
      </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
  </Styles.Resources>

However, this was not working for me, and unfortunately I'm not exactly sure why, since it worked in the past. What did work for me was the following, using MergeResourceInclude instead:

    <Application.Resources>
      <ResourceDictionary>
          <ResourceDictionary.MergedDictionaries>
              <MergeResourceInclude Source="/Resources/Fonts.axaml" />
          </ResourceDictionary.MergedDictionaries>
      </ResourceDictionary>
  </Application.Resources>

Perhaps this should be mentioned in the docs somewhere?

Also, my Avalonia version is 11.1.0-rc2, so apologies if there may be some changes that I don't know about, since the docs appear to be on 11.0.x.

Thanks!

@maxkatz6
Copy link
Member

This ResourceInclude example should work, syntax is correct. Something wrong might be with file path, but error info could have help.

MergeResourceInclude Not Mentioned

It wasn't included, as it's rather a lower-level feature we don't recommend using, unless you exactly know what it is.

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

No branches or pull requests

2 participants