dotnet / wpf

WPF is a .NET Core UI framework for building Windows desktop applications.
MIT License
7.1k stars 1.17k forks source link

Unseal TextBlock OnPropertyChanged #6752

Open tonyhallett opened 2 years ago

tonyhallett commented 2 years ago

https://github.com/dotnet/wpf/blob/89d172db0b7a192de720c6cfba5e28a1e7d46123/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/TextBlock.cs#L1682

This is the only FrameworkElement that overrides and then seals.

gurpreet-wpf commented 2 years ago

@tonyhallett Can you please elaborate on what problem are you facing in your application?

tonyhallett commented 2 years ago

I wanted my derivation to use OnPropertyChanged. I wanted to provide a generic solution across multiple controls and overriding metadata in a static constructor is not an option.

For my use case I have been able to use multi binding.