dotnet / dotnet/wpf

Proposal: Remove restriction to only allow event triggers in FrameworkElement.Triggers collection

Open
#10,048 0 comments 1 reaction 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

# Current Situation

Currently, property triggers are only available by takting the detour using the [`FrameworkElement.Style`](https://learn.microsoft.com/en-us/dotnet/api/system.windows.frameworkelement.style) property and its [`Style.Triggers`](https://learn.microsoft.com/en-us/dotnet/api/system.windows.style.triggers) collection. Assigning a property trigger immediately to the [`FrameworkElement.Triggers`](https://learn.microsoft.com/en-us/dotnet/api/system.windows.frameworkelement.triggers) collection raises an error.

This restriction makes no sense and is a quirk that's repeatedly causing confusion and unneccessary ado.

# Desired Situation

I propose to remove the current artificial restriction for the `FrameworkElement.Triggers` collection that's constraining it to only accept event triggers and to harmonize the `FrameworkElement.Triggers` collection's feature set with the `Style.Triggers` feature set.

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.