How to create .NET MAUI Vertical Slider?
By using Syncfusion .NET MAUI Slider, you can create a vertical slider easily by following these steps:
Step 1: Create a .NET MAUI application project in Visual Studio.
Step 2: Add the Syncfusion.Maui.Sliders NuGet to the project from nuget.org by opening the NuGet package manager in Visual Studio, then search for Syncfusion.Maui.Sliders and install it.
Step 3: In the MauiProgram.cs file, register the Syncfusion.Maui.Core handler as shown in the following code sample.
Using C#
using Syncfusion.Maui.Core.Hosting; namespace SliderDemo { public static class MauiProgram { public static MauiApp CreateMauiApp() { var builder = MauiApp.CreateBuilder(); builder .UseMauiApp<App>() .ConfigureSyncfusionCore(); return builder.Build(); } } }
The Syncfusion.Maui.Core package is dependent on Syncfusion.Maui.Sliders NuGet package, and it will be installed automatically when you install the Syncfusion.Maui.Sliders package in step 2.
Step 4: Add the .NET MAUI Sliders’ control namespace to the MainPage.xaml.
Using XAML
xmlns:sliders="clr-namespace:Syncfusion.Maui.Sliders;assembly=Syncfusion.Maui.Sliders"
Using C#
using Syncfusion.Maui.Sliders;
Step 5: Now, initialize the SfSlider as shown in the following code sample and set the SfSlider.Orientation property value as Vertical.
Using XAML
<ContentPage.Content> <sliders:SfSlider Orientation="Vertical" /> </ContentPage.Content>
Using C#
// Initializing SfSlider. SfSlider slider = new SfSlider(); slider.Orientation = SliderOrientation.Vertical; this.Content = slider;
Output
Check the following links for more features in Syncfusion MAUI Sliders: