Closed AchimStuy closed 1 year ago
The IValueConverter
interface is platform specific (it's a different type for WinForms, WPF, UWP, MAUI, ...). So it's not possible to provide value converters with the platform independent target frameworks that the MVVM Toolkit currently uses.
The "Windows Community Toolkit" and "MAUI Community Toolkit" projects already provide converters: https://learn.microsoft.com/en-us/windows/communitytoolkit/helpers/converters https://learn.microsoft.com/en-us/dotnet/communitytoolkit/maui/converters/
It seems like there is no "WPF Community Toolkit" project yet. That would have to provide converters for WPF (which I assume you meant, because you linked the WPF IValueConverter
interface).
Yeah all converters are in framework specific libraries, such as the Windows Community Toolkit 🙂
We don't really plan on adding them to the MVVM Toolkit, which is platform agnostic.
Additionally, converters should be avoided when possible on new frameworks (using x:Bind
to function instead).
Oh, I thought the System.Windows.Data.IValueConverter
would be used for all Frameworks. Didn't know that.
If you should ever decide to make a WPF Community Toolkit, just tell me and I'll provide the converters and some other stuff. 🙂
Overview
We would like to migrate from our own MVVM library to CommunityToolkit.MVVM. In our library we have implemented several frequently used
IValueConverter
s, which I would like to have in the CommunityToolkit. Can these be added? Where? I'd propose a new folder Converters in theCommunityToolkit.Mvvm
project.API breakdown
(each with
Reverse
property)Usage example
Breaking change?
No
Alternatives
The converters could also be added to the .NET code, but this would not make it available to our net48 applications.
Additional context
No response
Help us help you
Yes, I'd like to be assigned to work on this item