Replies: 1 comment 2 replies
-
I am using the standard .Net IHost in all my Avalonia apps mostly for dependency injection and singleton management. You may wish to take a look at: HTH |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm wondering if anyone has explored adding support for the standard dotnet application
IHost
functionality to Avalonia applications.You could think of it as being vaguely like having this in your
App.axaml.cs
:Perhaps there's a better way that's already been explored, but the code example above is just to illustrate the premise. With this in place, it should in theory be easy to integrate with the rest of the dotnet library ecosystem. Particularly through DI and configuration. Maybe I should be managing the
IHost
fromProgram.cs
instead?But I'm wondering if there are any threading gotchas that might be important to anticipate in such an approach. Or when code running in the
IHost
thread needs to trigger things in the main Avalonia UI thread?Interested in hearing more from anyone who has either done this or has insights! 🙏
Beta Was this translation helpful? Give feedback.
All reactions