-
Notifications
You must be signed in to change notification settings - Fork 711
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ColorHelper.ToDisplayName
still appears to be missing since before 1.0?
#8287
Comments
@michael-hawker |
@DarranRowe Color.ToString returns the hex representation of the colour, not the display name. From the docs:
|
Hmm, well, I have to admit that I'm not exactly that familiar with the C# projection. |
@DarranRowe Are you running as packaged or unpackaged. Maybe this has to do with it using old MRT (Windows.ApplicationModel.Resources) instead of MRT Core from Windows App SDK (Microsoft.Windows.ApplicationModel.Resources). Or maybe it's dependent on the UWP XAML framework to be initialized, even though the ColorHelper class itself is not under the Windows.UI.Xaml namespace. |
@JaiganeshKumaran |
@DarranRowe Probably the UWP XAML framework needs to be initialised first then. |
@JaiganeshKumaran By the looks of it. I dug in a little more and it was getting a null pointer from a TLS slot. I then had the brilliant idea to initialise Xaml Islands for the UI thread and it worked. |
- Updated to `CommunityToolkit.WinUI.Converters` namespace - Changed `FormatStringConverter` to `IFormattableToStringConverter` to differentiate from `StringFormatConverter` (too confusing to have such a similar name) - Merged differences between UWP and WinAppSDK branches of main toolkit, _have proper updates from both_ - Imported original monolith doc from our doc repo as a starting point, converted one sample as a starting point for `StringFormatConverter` - Brought over existing unit tests from main repo (**did not** compare or merge with WinUI branch **nor** update to use our helpers), but passing for UWP and WASDK - Found platform gap for ColorToDisplayNameConverter, see microsoft/microsoft-ui-xaml#8287
I think this function just needs to be ported/exposed to the new |
This was added in Wasdk 1.6 preview1 https://learn.microsoft.com/en-us/windows/apps/windows-app-sdk/preview-channel#other-notable-changes |
Fixed in 1.6.0; closing issue. |
@bpulliam
ToDisplayName
still appear to be missing in the latest release, this never seemed resolved here on how we're supposed to upgrade these code paths. Also see: MicrosoftDocs/winrt-api#2120This effects our
ColorToDisplayNameConverter
in the toolkit, so not sure what to do with our comment here:Originally posted by @michael-hawker in #5260 (comment)
Someone mentioned using the original
Windows.UI
one, but that doesn't seem to work either.I get red squiggles trying to use the Windows.UI version explicitly
Windows.UI.ColorHelper.ToDisplayName(color)
:The text was updated successfully, but these errors were encountered: