dotnet / dotnet/wpf

Make TriggerBase constructor public

Open
#2,697 0 comments 3 reactions 0 assignees View on GitHub
Enhancement Requested
Dominant language
C#
Stars
7.7k
Forks
1.3k
Avg merge
1d 11h
Merged PRs (30d)
61

Description

Is there a good reason why the TriggerBase constructor is not public (see https://github.com/dotnet/wpf/blob/ac9d1b7a6b0ee7c44fd2875a1174b820b3940619/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/TriggerBase.cs#L41 )

TriggerBase is part of the Core framework, but could be inherited by other libraries as well.

In my case I had the idea to implement a SwitchDataTrigger, that switches between different values of a binding, providing multiple cases at once - without the need to cascade through different Triggers, all with the same Binding.
I'd like to try implementing that as a library (for now) - not sure if it's of interest for WPF itself, but it get's ~~incredibly complex as I have to reimplement the whole basics again due to the internal constructor~~ impossible to do as I can't inherit from TriggerBase, but Style.Triggers requires all Triggers to derive from that.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.