Open LadderLogic opened 3 years ago
Is this not something that can be done using function bindings?
<StackPanel Visibility="{x:Bind _featureManager.IsEnabled('FeatureX')}">
<Button Click="button_Click">Start Feature X</Button>
</StackPanel>
Your example syntax could actually even work today, provided an attached property is used.
In any case, I don't think this is worth adding a language-specific feature to XAML (keep in mind XAML must support C++ as well).
Is this not something that can be done using function bindings?
<StackPanel Visibility="{x:Bind _featureManager.IsEnabled('FeatureX')}"> <Button Click="button_Click">Start Feature X</Button> </StackPanel>
Your example syntax could actually even work today, provided an attached property is used.
In any case, I don't think this is worth adding a language-specific feature to XAML (keep in mind XAML must support C++ as well).
@sylveon This is in fact what I've done in my previous WPF/XAML projects, to wire-up my own XAML markup extensions, attached properties and other plumbing for feature management. I am not suggesting a XAML fix, but adding a feature to the framework/SDK. Similar to how ASP .NET Core has FeatureManagement API, I am suggesting that there should be an SDK level Feature Management option.
Like @sylveon said, you can accomplish this with an attached property, I don't see why it's necessary to add it to the SDK itself. Maybe this is something that can be added to https://github.com/CommunityToolkit/WindowsCommunityToolkit?
feature proposal
ASP .NET Core has great support for Feature Modeling using Microsoft.FeatureManagement. The feature filter feature is available at both controller and view level (from microsoft/FeatureManagement-Dotnet):
Would it be possible to extend the FeatureManagement API to work with Windows Applications including XAML support like this?
For additional context, here's a description of ASP.NET Core's feature management: