Skip to content

Commit

Permalink
Handle missing ColorHelper.ToDisplayName implementation on Uno. See u…
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlodotexe committed Aug 22, 2024
1 parent dbe7157 commit 5f3fb6d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions components/Converters/src/ColorToDisplayNameConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,13 @@ public object Convert(
// Invalid color value provided
return DependencyProperty.UnsetValue;
}

#if !WINAPPSDK && !HAS_UNO
#if HAS_UNO
// ColorHelper.ToDisplayName not yet supported on Uno Platform.
// Track https://github.com/unoplatform/uno/issues/18004
return "Not supported";
#elif WINUI2
return Windows.UI.ColorHelper.ToDisplayName(color);
#else
#elif WINUI3
return Microsoft.UI.ColorHelper.ToDisplayName(color);
#endif
}
Expand Down

0 comments on commit 5f3fb6d

Please sign in to comment.