Feedback on Windows.ApplicationModel.Background.SystemCondition

AxD 661 Reputation points
2020-10-15T17:55:06.103+00:00

Invited by https://learn.microsoft.com/en-us/uwp/api/windows.applicationmodel.background.backgroundtaskbuilder.addcondition, suggesting to leave feedback on the product, I cannot withhold from signifying my astonishment about a cumbersome design like this:

A class (SystemCondition) with an enum as sole constructor parameter, representing just that enum? And the enum itself (SystemConditionType) doesn't come with a FlagsAttribute and binary values to be able to provide more than one condition in a single call to BackgroundTaskBuilder.AddCondition?

Really? How awkward is that?

Why didn't they just enable a construct like this:

BackgroundTaskBuilder.AddCondition(SystemConditionType.SessionConnected | SystemConditionType.InternetAvailable);  
Universal Windows Platform (UWP)
{count} votes