Skip to content

Problem with ApplicationConfiguration source generator #5925

@hamarb123

Description

@hamarb123

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

Yes, I was wanting to have code like if (!Application.SetHighDpiMode(HighDpiMode.PerMonitorV2)) Application.SetHighDpiMode(HighDpiMode.PerMonitor); in my Program file, but it seems like ApplicationConfiguration.Initialize(); forces me to use its implementation.

Describe the solution you'd like and alternatives you've considered

Something like <ApplicationHighDpiMode></ApplicationHighDpiMode> or <ApplicationHighDpiMode>unset</ApplicationHighDpiMode> could disable that line in the source generator.

An alternative could be something like <ApplicationHighDpiMode>PerMonitorV2OrPerMonitor</ApplicationHighDpiMode> to specify the fallback I wrote above (perhaps including SystemAware as well).

The user could also just put it before ApplicationConfiguration.Initialize(); and it would fail to set in there, but setting it twice seems like a bad solution to me since it's unnecessary.

Will this feature affect UI controls?

Not that I'm aware of.

Metadata

Metadata

Assignees

No one assigned

    Labels

    api-suggestion(1) Early API idea and discussion, it is NOT ready for implementation

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions