Споделяне чрез


Xamarin.Forms Shell

Introduction

Xamarin.Forms Shell reduces the complexity of mobile application development by providing the fundamental features that most mobile applications require. This includes a common navigation user experience, a URI-based navigation scheme, and an integrated search handler.

Create a Xamarin.Forms Shell application

The process for creating a Xamarin.Forms Shell application is to create a XAML file that subclasses the Shell class, set the MainPage property of the application's App class to the subclassed Shell object, and then describe the visual hierarchy of the application in the subclassed Shell class.

Flyout

A flyout is the optional root menu for a Shell application, and is accessible through an icon or by swiping from the side of the screen. The flyout consists of an optional header, flyout items, optional menu items, and an optional footer.

Tabs

After a flyout, the next level of navigation in a Shell application is the bottom tab bar. Alternatively, the navigation pattern for an application can begin with bottom tabs and make no use of a flyout. In both cases, when a bottom tab contains more than one page, the pages will be navigable by top tabs.

Pages

A ShellContent object represents the ContentPage object for each FlyoutItem or Tab.

Shell applications can utilize a URI-based navigation scheme that uses routes to navigate to any page in the application, without having to follow a set navigation hierarchy.

Shell applications can use integrated search functionality that's provided by a search box that can be added to the top of each page.

Lifecycle

Shell applications respect the Xamarin.Forms lifecycle, and additionally fire an Appearing event when a page is about to appear on the screen, and a Disappearing event when a page is about to disappear from the screen.

Custom renderers

Shell applications are customizable through the properties and methods that the various Shell classes expose. However, it's also possible to create Shell custom renderers when more sophisticated platform-specific customizations are required.