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

Read platform options from runtime config #17578

Open
maxkatz6 opened this issue Nov 20, 2024 · 0 comments
Open

Read platform options from runtime config #17578

maxkatz6 opened this issue Nov 20, 2024 · 0 comments

Comments

@maxkatz6
Copy link
Member

Is your feature request related to a problem? Please describe.

Currently, any platform option, such as Win32PlatformOptions { RenderingMode = {} } is defined only via C# code.
There is a number of cases, when runtime config, defined on the project level, is move convenient and flexible approach. This is also a common approach for .NET runtime features.

In perspective, if we migrate completely to runtime configs, and drop C# classes, we could support trimming of unused code compile time as well.

Describe the solution you'd like

It's up to debate how we should prioritize runtime config options compared to C# platform options.
But I would suggest:

  1. If runtime option is defined, with either value - use it. Completely ignore C# platform options, allowing as to do trimming in perspective.
  2. If runtime option is not defined, read C# platform options. It also helps with the fact, that most of our platform options are not nullable, and always have at least some value.
  3. If none is defined, fallback to what Avalonia considers default behavior in current release.

Describe alternatives you've considered

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant