Color conversion in the WP8 renderer

MitchMilamMitchMilam USMember ✭✭✭

What is the secret to converting from a Xamarin.Forms.Color to a System.Windows.Media.Color inside of a custom renderer?

There are no .To methods and you can't typecast it either.

It's got to be something simple that I am missing. Any ideas?

Thanks, Mitch

Posts

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    yap, this is a normal behavior in Windows Phone , you paint something with a brush, not a color, for example you can set current brush to be a GradientBrush.

  • MitchMilamMitchMilam USMember ✭✭✭

    Gotcha. Thanks for the info Rui.

    Thank God for Telerik JustDecompile. Had to go look at the code to figure out what was happening internally.

  • PriyabrataDashPriyabrataDash USMember ✭✭

    Nice find @MitchMilam‌.
    Saved my time.
    One can use this like following.

    Fill = (SolidColorBrush) converter.Convert(Element.ProgressColor, null, null, null)

Sign In or Register to comment.