0

I'm developing MAUI project and having SelectionBackground API (in Brush type) and have to set this color to native view's (UIView) background (which is UIColor type) or set to IView's background (which is Paint type). So i need to convert that Brush value to Paint or UIColor type, but i can't find the solution for this.

Please help me to resolve this.

Thanks.

Prithiv
  • 504
  • 5
  • 20
  • 2
    Are you referring the class `Microsoft.Maui.Controls.Brush` ? You can directly convert it to `Paint` , because it defines `implicit operator` between `Paint` and `Brush` . – ColeX Nov 23 '21 at 08:53
  • @ColeX-MSFT - to make sure I understand this: Such code would be within a MAUI custom "handler", as described in [Customize controls with handlers](https://learn.microsoft.com/en-us/dotnet/maui/user-interface/handlers/customize)? Inside `#if __IOS__` ... `#endif`, so that it would know the native type to convert to? – ToolmakerSteve Dec 15 '21 at 03:23

0 Answers0