Create a Wizard View in Xamarin.Forms: A Novice's Guide
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (173).NET Core  (29).NET MAUI  (203)Angular  (107)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (40)Black Friday Deal  (1)Blazor  (211)BoldSign  (13)DocIO  (24)Essential JS 2  (106)Essential Studio  (200)File Formats  (65)Flutter  (132)JavaScript  (219)Microsoft  (118)PDF  (81)Python  (1)React  (98)Streamlit  (1)Succinctly series  (131)Syncfusion  (897)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (50)Windows Forms  (61)WinUI  (68)WPF  (157)Xamarin  (161)XlsIO  (35)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (146)Chart  (127)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (618)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (39)Extensions  (22)File Manager  (6)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (501)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (42)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (10)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (381)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (17)Web  (582)What's new  (323)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)
Create a Wizard View in Xamarin.Forms: A Novice's Guide

Create a Wizard View in Xamarin.Forms: A Novice’s Guide

A wizard control is an interactive, customizable user interface that can hold more than one page. It is useful in showcasing step-by-step processes, and also helps break a complex task into simple steps. Using a wizard interface in a project simplifies the design and code work of developers. In this blog, we are going to create a simple walk-through page (wizard view) for a scheduler component using the Syncfusion Xamarin Rotator control.

Our Xamarin Rotator control is a UI that provides an interactive way to move from one image to another and navigate through a collection of views. It supports various navigation options like swiping, autoplay, and tapping. It has all the necessary features that a wizard control possesses. So, let’s design a beautiful wizard view with it!

Designing a Wizard View Using Xamarin Rotator Control
Designing a Wizard View Using Xamarin Rotator Control

Creating a wizard view

Follow these steps to create a wizard view using the Xamarin Rotator control:

  1. Follow the Getting Started with Xamarin Rotator Control documentation to add a Xamarin.Forms SfRotator control to your application.
  2. Let’s initialize the Rotator control and set the following necessary properties based on the UI requirements:
    • Set the DotPlacement property as none and the NavigationDirection property as horizontal.
    • Then, enable the swiping gesture in the Rotator control by setting the EnableSwiping property as True and disable looping by setting the EnableLooping property as False.

    Refer to the following code example.

    <sfRotator:SfRotator x:Name="Rotator"
                           BackgroundColor="Transparent"
                           DotPlacement="None"
                           EnableLooping="False"
                           EnableSwiping="True"
                           NavigationDirection="Horizontal" >
  3. In this walk-through, I’m going to load a Scalable Vector Graphics (SVG) image. Create a DataTemplate with an SVG image and two labels for the header and content of the page. Then, assign the DataTemplate to the ItemTemplate property of the Xamarin Rotator control.Refer to the following code example.
    <sfRotator:SfRotator.ItemTemplate>
        <DataTemplate>
            <StackLayout BackgroundColor="Transparent"
                         Spacing="0"
                         VerticalOptions="Center">
    
                <!-- Image for display svg image -->
                <svg:SVGImage BackgroundColor="Transparent"
                              Source ="{Binding ImagePath}"
                              VerticalOptions="Center" />
    
                <!-- Label to display header -->
                <Label FontFamily="{StaticResource Montserrat-SemiBold}"
                       FontSize="20"
                       HorizontalTextAlignment="Center"
                       Text="{Binding Header}"
                       VerticalTextAlignment="Center" />
    
                <!-- Label to display content -->
                <Label FontFamily="{StaticResource Montserrat-Medium}"
                       FontSize="16"
                       Text="{Binding Content}"
                       VerticalTextAlignment="Center" />
            </StackLayout>
        </DataTemplate>
    </sfRotator:SfRotator.ItemTemplate>
  4. Then, create a model class with the required properties for the page.
    public class PageModel
    { 
    #region Properties
    
        /// <summary>
        /// Gets or sets the image.
        /// </summary>
        public string ImagePath { get; set; }
    
        /// <summary>
        /// Gets or sets the header.
        /// </summary>
        public string Header { get; set; }
    
        /// <summary>
        /// Gets or sets the content.
        /// </summary>
        public string Content { get; set; }
    
        /// <summary>
        /// Gets or sets the view.
        /// </summary>
        public View RotatorItem { get; set; }
    
    #endregion
    }
  5. Now, create a ViewModel class containing the business logic for the wizard control.
    public class PageViewModel 
    {
    #region Fields
    
    private ObservableCollection<PageModel> pages;
    
    #endregion
    
    #region Constructor
    
    /// <summary>
    /// Initializes a new instance for the <see cref=" PageViewModel " /> class.
    /// </summary>
    public PageViewModel ()
    {
        this.Pages= new ObservableCollection<PageModel>
        {
            new PageModel()
            {
                ImagePath = "ReSchedule.png",
                Header = "RESCHEDULE",
                Content = "Drag and drop meetings in order to reschedule them easily.",
                RotatorItem = new WalkthroughItemPage()
            },
            new Boarding()
            {
                ImagePath = "ViewMode.png",
                Header = "VIEW MODE",
                Content = "Display your meetings using four configurable view modes",
                RotatorItem = new WalkthroughItemPage()
            },
            new Boarding()
            {
                ImagePath = "TimeZone.png",
                Header = "TIME ZONE",
                Content = "Display meetings created for different time zones.",
                RotatorItem = new WalkthroughItemPage()
            }
        };
    
    }
    
    #endregion
    
    #region Properties
    
    public ObservableCollection<PageModel> Pages
    {
        get
        {
            return this.pages;
        }
        set
        {
            if (this.pages== value)
            {
                return;
            }
    
            this.pages= value;
            this.NotifyPropertyChanged();
        }
    }
    
    #endregion
  6. Finally, assign the Pages property of the ViewModel to the ItemsSource property of the Rotator control.
    <sfRotator:SfRotator
             x:Name="Rotator"
               DotPlacement="None"
               EnableLooping="False"
               EnableSwiping="True"
               ItemsSource="{Binding Boardings}"
               NavigationDirection="Horizontal"
               SelectedIndex="{Binding SelectedIndex, Mode=TwoWay}">
     
        <sfRotator:SfRotator.ItemTemplate>
           <DataTemplate>
              <StackLayout>
     
                <!--  Image for display svg image  -->
                <svg:SVGImage BackgroundColor="Transparent"                               
                      Source ="{Binding ImagePath}" />
     
                 <!--  Label to display header  -->
                 <Label Text="{Binding Header}" />
     
                 <!--  Label to display content  -->
                 <Label Text="{Binding Content}" />
             </StackLayout>
          </DataTemplate>
       </sfRotator:SfRotator.ItemTemplate>
     </sfRotator:SfRotator>

Output

After executing the above code examples, we will get the wizard view pages shown in the .gif image.

Designing a Wizard View Using Xamarin Rotator Control
Designing a Wizard View Using Xamarin Rotator Control

Resource

For more information refer to the Creating Wizard View using Xamarin Rotator sample.

Conclusion

Thanks for reading! I hope you now have a clear idea of how to create a wizard view using our Xamarin Rotator control. With a wizard view, you can easily add a sequence for your users by splitting it into stages. This will reduce your workload and save coding time, and also help you create a highly customizable component.

Our Rotator control is available in our ASP.NET Web Forms, UWP, and Xamarin platform suites. Try them out and leave your feedback in the comments section below!

If you are an existing Syncfusion user, you can download the latest version from the License and Downloads page and try the new features for yourself. Also, our NuGet packages are available on NuGet.org.

If you aren’t a customer yet, you can try our 30-day free trial to check out these features. Also, try our other samples from this GitHub location.

You can also contact us through our support forums, Direct-Trac, or feedback portal. We are always happy to assist you!

Related blogs

Tags:

Share this post:

Comments (2)

Hi! thanks for the tutorial. Could you clarify how did you include the Next & Done buttons? Is that part of the SfRotator options?

Hi Javier,

Greetings from Syncfusion. We don’t have built-in Next and Done buttons in Rotator control. In the above blog, we had a grid control where the Rotator and the done and next buttons are placed as an overlay. Please have a look at the below sample codes.
sample: https://github.com/SyncfusionExamples/xamarin-sfrotator-samples/tree/main/WizardControlXamarin

Please contact our support if you have any queries or any requirements. We will guide you.

Regards,
Paul Anderson

Comments are closed.

Popular Now

Be the first to get updates

Subscribe RSS feed

Be the first to get updates

Subscribe RSS feed