Friday, 11 January 2019

The Future of Mobile Development: Xamarin.Forms 4.0 Preview


Xamarin.Forms 4.0.0-pre1 is a substantial release with several big new features. As such, we are releasing much earlier than usual to get more feedback not only on the quality of the release, but on the use of the features while we are still developing them.

While we work on 4.0.0, we will continue releasing quality improvements and minor enhancements via the 3.x series approximately every 6 weeks.

To get started with Xamarin.Forms 4.0 enable all the new features in your MainActivity.cs and AppDelegate.cs via the feature flags api:
C#

global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "Visual_Experimental", "CollectionView_Experimental");
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

Here's what you have to look forward to:
Shell

Shell introduces a simplified way to express the structure and navigation for your application in a single file. No more dealing with different page types to handle setting up complicated navigation. It supports flyout menu, bottom tabs, top tabs, and an integrated search handler. A new URI based navigation routing system has been implemented in addition to the existing push/pop navigation service. Now you can route to any point in your application, no matter how deep, and handle navigation events to perform custom logic such as canceling the back action.

To get started, add a new ContentPage with XAML to your project and modify the code below to match your namespace:
XML


<shell flyoutbehavior="Disabled" route="NewApp" routehost="companyname.com" routescheme="app" title="NewApp" x:class="NewApp.AppShell" xmlns:local="clr-namespace:NewApp" xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns="http://xamarin.com/schemas/2014/forms">

    <!--
        Styles and Resources
    -->
    <shell .resources="">
        <resourcedictionary>
            <color x:key="NavigationPrimary">#2196F3</color>
            <style targettype="Element" x:key="BaseStyle">
                <setter Property="Shell.ShellBackgroundColor" Value="{StaticResource NavigationPrimary}" />
                <setter Property="Shell.ShellForegroundColor" Value="White" />
                <setter Property="Shell.ShellTitleColor" Value="White" />
                <setter Property="Shell.ShellDisabledColor" Value="#B4FFFFFF" />
                <setter Property="Shell.ShellUnselectedColor" Value="#95FFFFFF" />
                <setter Property="Shell.ShellTabBarBackgroundColor" Value="{StaticResource NavigationPrimary}" />
                <setter Property="Shell.ShellTabBarForegroundColor" Value="White"/>
                <setter Property="Shell.ShellTabBarUnselectedColor" Value="#95FFFFFF"/>
                <setter Property="Shell.ShellTabBarTitleColor" Value="White"/>
            </style>
            <style basedon="{StaticResource BaseStyle}" targettype="ShellItem">
        </ResourceDictionary>
    </Shell.Resources>

    <!-- Your Pages -->
    <shellitem>
        <shellcontent>
            <local:MainPage/>
        </ShellContent>
    </ShellItem>

</Shell>

Then set this AppShell class as your main page in the App.xaml.cs file:
C#

namespace NewApp
{
    public partial class App : Application
    {
        public App ()
        {
            InitializeComponent();

            MainPage = new AppShell();
        }
    }
}

For more information about Shell check out the preview doc and view the Tailwind Traders mobile reference app. If you're evaluating Visual Studio 2019 on Windows, we've created a set of Shell templates for you. Download and install the package here.
Visual

Visual is a new way to achieve consistent UI design across iOS and Android, beginning with an implementation of Google's Material Design. This first iteration include Button, Entry, Frame, and ProgressBar. Visual goes beyond styles to also unify behavior and when necessary providing highly customize renderers.

Xamarin.Forms Visual on Android and iOS

For more information about Visual, check out the preview doc.
CollectionView and CarouselView

CollectionView is the flexible and performant list control that you've been asking for. It can handle horizontal, vertical, and grid layouts out of the box, and you can provide custom layouts as well. CollectionView is also the foundation for CarouselView. Read More...

Read more from On blog Xamarin



 

2 comments:

  1. Thanks for sharing this blog!!!

    I am New in Xamarin app development.. and this blog is really helpful for me..

    Hire Xamarin Developer

    ReplyDelete
  2. On this page you can read my interests, write something special. search property auctions

    ReplyDelete

All About .NET MAUI

  What’s .NET MAUI? .NET MAUI (.NET Multi-platform App UI) is a framework for building modern, multi-platform, natively compiled iOS, Androi...

Ads2