MAUI - How can slider reduction be prevented?

Sakshi Poojary 55 Reputation points
2024-07-02T15:01:31.2433333+00:00

In my MAUI application, I am using a slider to set a timer. The user can set the desired time by sliding the slider to the appropriate position. Once the timer is started, I want to prevent the user from reducing the set time until the timer completes its countdown. This ensures that the timer runs uninterrupted for the full duration initially set by the user. How can I do this on my MAUI application?

The user should be able to increase the timer using the slider. Restriction is only to reduce the timer.

Below is the Slider code added on the XAML page:

<Slider
    x:Name="watchme_slider"
    Grid.Column="1"
    BackgroundColor="White"
    MinimumTrackColor="#1c98d7"
    MaximumTrackColor="#9a9a9a"
    ThumbImageSource="ic_thumb_xx.png"
    ValueChanged="SliderValueChanged"
    Maximum="0.166666667"
    Minimum="0"
    HorizontalOptions="FillAndExpand"/>
.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
3,134 questions
0 comments No comments
{count} votes