How do I add my own resources, without breaking actipro dependencies?

Themes, Shared, and Core Libraries for Avalonia Forum

Posted 1 month ago by ZeroOne
Avatar

Hi! I'm trying to add my own Resources globally in App.axaml like so

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

This leads to actipro's resources becoming unavailabe, however. How do I resolve this conflict?

Comments (1)

Posted 1 month ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Our ThemeManager will update the MergedDictionaries collection in Application.Current.Resources to inject its own ResourceDictionary.  If your code above executes after our theme logic runs, such as if you put our theme loading logic before your app's InitializeComponent call instead of in OnStartup, I could see the XAML above blowing away what our theme manager injects.  Please make sure you structure your app codebehind logic like in the Themes Getting Started documentation and in our sample project and I would think it would work.


Actipro Software Support

Add Comment

Please log in to a validated account to post comments.