Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to change Color from Slider on Xamarin Mac Platform?

MProtocolMProtocol Member ✭✭
edited July 2018 in Xamarin.Forms

The default color from a Slider on Xamarin Mac project is blue, I want to change it to green, So I have made a Custom Renderer, but unfortunately, I don't what to do inside the custom renderer, How can I change the color?

    using CustomSliderColor.MacOS;
    using Xamarin.Forms;
    using Xamarin.Forms.Platform.MacOS;

    [assembly: ExportRenderer(typeof(CustomSlider), typeof(CustomSliderRenderer))]
    namespace CustomSliderColor.MacOS
    {
        public class CustomSliderRenderer : SliderRenderer
        {
            protected override void OnElementChanged(ElementChangedEventArgs<Slider> e)
            {
                base.OnElementChanged(e);

                if (Control != null)
                {
                    //What do I put here?????
                }
            }
        }
    }

Best Answer

Sign In or Register to comment.