×

iFour Logo

Roadmap to Xamarin Forms 5.0

Kapil Panchal - January 21, 2021

Listening is fun too.

Straighten your back and cherish with coffee - PLAY !

  • play
  • pause
  • pause
Roadmap to Xamarin Forms 5.0

Xamarin forms 5.0 can release the new features including Brushes, RadioButton, CarouselView, App Themes (Dark Mode), Shapes and Paths, and SwipeView.

Upgrading to 5.0


  • Visual Studio 2019 will be the minimum required version for using Xamarin forms 5.0.
  • Some UI markup extension like Expander, C#, and MediaElement has been moved to the Xamarin, install this NuGet packages and update the code. This is the probable library that has a lot of valuable solutions that every app need.
  • Some Xamarin Theme packages and the DataPages can be removed from the solution.

  • Some pages and types can be renamed like, MasterDetailPage has been renamed to FlyoutPage (MasterDetailPage. Master changed to FlyoutPage.Flyout and MasterBehavior changed to) and related types have been renamed to similar. Both changes are optional and your app can continue to work for now without making these changes.

Let’s see the Xamarin’s published new features.

 
  • Brushes
  • Drag-and-drop
  • CarouselView
  • IndicatorView
  • RadioButton
  • Shapes and Paths
  • SwipeView

Brushes

A brush is used to paint an area like any control’s background. The Brush is available in the Xamarin.forms namespace on Android, the Universal Windows Platform (UWP), iOS, macOS, and the Windows Presentation Foundation (WPF).

There are different types available in Xamarin forms to describe the brushes.

SolidColorBrush: This can be used for paints an area with a solid color, and this class derives from the Brush class. This class has an IsEmpty method that returns a bool.

LinearGradientBrush: This can be used to paints an area with a linear gradient, and the LinearGradientBrush class defines the following properties:

  • StartPoint: Represent the starting two-dimensional coordinates of the linear gradient. Default values of this property are (0,0).
  • EndPoint: Represent the ending two-dimensional coordinates of the linear gradient. Default values of this property are (1,1).

RadialGradientBrush: This can be used to paints an area with a radial gradient, and the RadialGradientBrush class defines the following properties:

  • Center: This property is used to getting a center point of the circle for the radial gradient. (0.5,0.5) is the default value of this property.
  • Radius: This property is used to getting the radius of the circle for the radial gradient. 0.5 is the default value of this property.

Drag-and-drop

A drag and drop gesture are used to arranged from one location to another location using a continuous gesture. In drag and drop gestures when the drag source is released, drop source occurs.

Let’s see some below steps to enable drag and drop in the application.

  • You can enable drag by adding a DragGestureRecognizer object to its GestureRecognizer collection. And set the DragGestureRecognizer.CanDrag property to true.
  • You can enable drop by adding a DropGestureRecognizer object to its GestureRecognizer collection. DropGestureRecognizer.AllowDrop property to true for enable drop.

CarouselView

Carousel view is used to show data in a scrollable layout. Users can swipe to move to the next items of the collection. In carousel view, all the items can display horizontal orientation by default. At a time, the only single item will be displayed on a screen you can swipe forwards and backward for the collection of items. Also, you can use indicators that can show each item in CarouselView. In carousel view, we can also add images, labels, and other virtual components.

Let’s see the carousel page example.

MainPage.Xaml




    

  








              

MainPage.Xaml.cs

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Xamarin.Forms;
namespace Xamarin5._0
{
    public partial class MainPage : CarouselPage
    {
        public MainPage()
        {
            InitializeComponent();
        }
    }
}
              
Output:

Carosual page Slide 1

Image: Carousel page slide 1

Carosual page Slide 2

Image: Carousel page slide 2

IndicatorView

An Indicator view is used to display several items, and also help in showing the current position of items. Indicator view is used with the carousel view.

Indicator view has some below properties:

  • Count: This property is used to count the number of indicators.
  • IndicatorColor: Color of the indicator.
  • SelectedIndicatorColor: For set the currently selected indicator color.
  • IndicatorSize: For the set, the size of the indicator and the default size of the indicator is 6.0.
  • IndicatorsShape: This property is used to change the shape of each indicator.

Now, let’s see how to create an indicator.



















              

The indicator view has an IndicatorsShape property for changing the indicator shape.

  • Circle: This is the default value of the IndicatorsShape property, and the shape will be circular.
  • Square: To create a square indicator.


              

RadioButton

RadioButton is inherited from TemplateView, and there is no longer a subclass of Button. Some changes like remove the Text property, added the Content property, added the value property.

The below classes can also be added

public static class RadioButtonGroup

public static readonlyBindablePropertyGroupNameProperty

public static readonlyBindablePropertySelectedValueProperty






              

Planning to Hire Xamarin App Development Company ? Your Search ends here.

Shapes and Paths

The shape is used to draw a shape on the screen and this class derives from the view class. For using shapes on Xamarin forms, we need to add namespace Xamarin.Forms.Shapes on Android, iOS, Universal Windows Platform(UWP), and Windows Presentation Foundation(WPF).


              

There are many more objects that derive from the shape class is Ellipse, Line, Path, Rectangle, Polygon, Polyline.


              

SwipeView

The SwipeView is used to wrap the item of content. The swipe view can provide a context menu by a swipe gesture. There is a four-swipe directional collection available - LeftItems, RightItems, TopItems, or BottomItems.











              

Conclusion


Xamarin forms 5.0 come up with many advanced features that is good for developing an application. They made some changes, update some existing controls, and remove some classes.

Roadmap to Xamarin Forms 5.0 Xamarin forms 5.0 can release the new features including Brushes, RadioButton, CarouselView, App Themes (Dark Mode), Shapes and Paths, and SwipeView. Upgrading to 5.0 Visual Studio 2019 will be the minimum required version for using Xamarin forms 5.0. Some UI markup extension like Expander, C#, and MediaElement has been moved to the Xamarin, install this NuGet packages and update the code. This is the probable library that has a lot of valuable solutions that every app need. Some Xamarin Theme packages and the DataPages can be removed from the solution. Some pages and types can be renamed like, MasterDetailPage has been renamed to FlyoutPage (MasterDetailPage. Master changed to FlyoutPage.Flyout and MasterBehavior changed to) and related types have been renamed to similar. Both changes are optional and your app can continue to work for now without making these changes. Let’s see the Xamarin’s published new features.   Brushes Drag-and-drop CarouselView IndicatorView RadioButton Shapes and Paths SwipeView Brushes A brush is used to paint an area like any control’s background. The Brush is available in the Xamarin.forms namespace on Android, the Universal Windows Platform (UWP), iOS, macOS, and the Windows Presentation Foundation (WPF). There are different types available in Xamarin forms to describe the brushes. SolidColorBrush: This can be used for paints an area with a solid color, and this class derives from the Brush class. This class has an IsEmpty method that returns a bool. LinearGradientBrush: This can be used to paints an area with a linear gradient, and the LinearGradientBrush class defines the following properties: StartPoint: Represent the starting two-dimensional coordinates of the linear gradient. Default values of this property are (0,0). EndPoint: Represent the ending two-dimensional coordinates of the linear gradient. Default values of this property are (1,1). RadialGradientBrush: This can be used to paints an area with a radial gradient, and the RadialGradientBrush class defines the following properties: Center: This property is used to getting a center point of the circle for the radial gradient. (0.5,0.5) is the default value of this property. Radius: This property is used to getting the radius of the circle for the radial gradient. 0.5 is the default value of this property. Drag-and-drop A drag and drop gesture are used to arranged from one location to another location using a continuous gesture. In drag and drop gestures when the drag source is released, drop source occurs. Let’s see some below steps to enable drag and drop in the application. You can enable drag by adding a DragGestureRecognizer object to its GestureRecognizer collection. And set the DragGestureRecognizer.CanDrag property to true. You can enable drop by adding a DropGestureRecognizer object to its GestureRecognizer collection. DropGestureRecognizer.AllowDrop property to true for enable drop. Read More: Incredible App Themes For Xamarin.forms CarouselView Carousel view is used to show data in a scrollable layout. Users can swipe to move to the next items of the collection. In carousel view, all the items can display horizontal orientation by default. At a time, the only single item will be displayed on a screen you can swipe forwards and backward for the collection of items. Also, you can use indicators that can show each item in CarouselView. In carousel view, we can also add images, labels, and other virtual components. Let’s see the carousel page example. MainPage.Xaml MainPage.Xaml.cs using System; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Text; using System.Threading.Tasks; using Xamarin.Forms; namespace Xamarin5._0 { public partial class MainPage : CarouselPage { public MainPage() { InitializeComponent(); } } } Output: Image: Carousel page slide 1 Image: Carousel page slide 2 IndicatorView An Indicator view is used to display several items, and also help in showing the current position of items. Indicator view is used with the carousel view. Indicator view has some below properties: Count: This property is used to count the number of indicators. IndicatorColor: Color of the indicator. SelectedIndicatorColor: For set the currently selected indicator color. IndicatorSize: For the set, the size of the indicator and the default size of the indicator is 6.0. IndicatorsShape: This property is used to change the shape of each indicator. Now, let’s see how to create an indicator. The indicator view has an IndicatorsShape property for changing the indicator shape. Circle: This is the default value of the IndicatorsShape property, and the shape will be circular. Square: To create a square indicator. RadioButton RadioButton is inherited from TemplateView, and there is no longer a subclass of Button. Some changes like remove the Text property, added the Content property, added the value property. The below classes can also be added public static class RadioButtonGroup public static readonlyBindablePropertyGroupNameProperty public static readonlyBindablePropertySelectedValueProperty Planning to Hire Xamarin App Development Company ? Your Search ends here. See here Shapes and Paths The shape is used to draw a shape on the screen and this class derives from the view class. For using shapes on Xamarin forms, we need to add namespace Xamarin.Forms.Shapes on Android, iOS, Universal Windows Platform(UWP), and Windows Presentation Foundation(WPF). There are many more objects that derive from the shape class is Ellipse, Line, Path, Rectangle, Polygon, Polyline. SwipeView The SwipeView is used to wrap the item of content. The swipe view can provide a context menu by a swipe gesture. There is a four-swipe directional collection available - LeftItems, RightItems, TopItems, or BottomItems. Conclusion Xamarin forms 5.0 come up with many advanced features that is good for developing an application. They made some changes, update some existing controls, and remove some classes.
Kapil Panchal

Kapil Panchal

A passionate Technical writer and an SEO freak working as a Content Development Manager at iFour Technolab, USA. With extensive experience in IT, Services, and Product sectors, I relish writing about technology and love sharing exceptional insights on various platforms. I believe in constant learning and am passionate about being better every day.

Build Your Agile Team

Enter your e-mail address Please enter valid e-mail

Categories

Ensure your sustainable growth with our team

Talk to our experts
Sustainable
Sustainable
 
Blog Our insights
10 Executive Dashboard Examples for Consultants and CEOs
10 Executive Dashboard Examples for Consultants and CEOs

There is a principle behind every business. “If you don’t keep track of essentials, you won’t get clear direction, eventually causing your company to stumble.” To manage this scenario,...

How Spatial Data Analysis Improves Healthcare
How Spatial Data Analysis Improves Healthcare

Do you know when geospatial analysis took traction in healthcare? It was when John Snow, a London-based physician, used it to analyze the spread of cholera, which ultimately proved...

4 Types of Power BI Dashboards: Analytical, Strategic, Operational, and Tactical
4 Types of Power BI Dashboards: Analytical, Strategic, Operational, and Tactical

One interesting aspect you truly love about Power BI, as a CTO, is how it lets you step back and see the bigger picture of your business. Isn’t it? Without getting bogged down in minute...