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.

Slider ThumImage hides on Maximum value

mayankkarkimayankkarki Member ✭✭
edited October 2019 in Xamarin.Forms

In UWP, I am using slider control and setting triangle as thumb image. On extreme left or minimum value, image shows correctly. But on dragging it to maximum values it hides out on maximum value.
<Slider.ThumbImageSource> <OnPlatform x:TypeArguments="FileImageSource"> <On Platform="UWP" Value="Assets/Images/Triangle.png"/> </OnPlatform> </Slider.ThumbImageSource>

Best Answer


  • mayankkarkimayankkarki Member ✭✭

    Thanks, I checked the solution and that's exactly my requirement. But I am using slider control on portable code rather than uwp code. I have to share same code among android and ios also. But I am also trying to use SliderRenderer class to do platform specific changes.

  • LeonLuLeonLu Member, Xamarin Team Xamurai

    Yes, you can use Custom renderer to achieve it for specific platform.

    You can create it like following code.

      [assembly: ExportRenderer(typeof(CustomSlider), typeof(CustomSliderRenderer))]
     namespace ForteMultiplataform.UWP
    public class CustomSliderRenderer : SliderRenderer
        protected override void OnElementChanged(ElementChangedEventArgs<Slider> e)
            if (e.NewElement != null)
                Windows.UI.Xaml.Style sliderStyle = (Windows.UI.Xaml.Style)Windows.UI.Xaml.Application.Current.Resources["xxxxxstyle"];
                Control.Style = sliderStyle;
  • mayankkarkimayankkarki Member ✭✭

    Thanks, Using App.Current.Resources, I managed to set the slider style for uwp platform.

Sign In or Register to comment.