Xamarin.FormsShell Basic Course (3) Shell project constitutes

Xamarin.FormsShell Basic Course (3) Shell project constitutes

In ShellDemo solutions created, there are three sub-projects, namely ShellDemo, ShellDemo.Android and ShellDemo.iOS. Project ShellDemo.Android and ShellDemo.iOS functions and create a blank template is the same, not here in the introduction, this section will detail ShellDemo subprojects.

ShellDemo consists of four sub folders (Models, Services, ViewModels and Views), two axml (App.xaml, AppShell.xaml) and two files cs files (App.xaml.cs, AppShell.xaml.cs) configured . The following will explain these elements in turn. 

  • Models folder: The folder has a Item.cs file. Create a file in Item.cs Item class, there are three attributes in this class, namely Id, Text and Description.
  • Services folder: folder there are two files in the file, respectively IDataStore.cs and MockDataStore.cs. Which, IDataStore.cs file creates a IDataStore interface. The MockDataStore.cs file creates a MockDataStore class that implements IDataStore interface.
  • ViewModels folder: This folder contains four files, respectively AboutViewModel.cs, BaseViewModel.cs, ItemDetailViewModel.cs and ItemsViewModel.cs file. These documents help from the Model data management, make it more suitable View.
  • Views folder: This folder contains eight files, respectively AboutPage.xaml, ItemDetailPage.xaml, ItemsPage.xaml, NewItemPage.xaml, AboutPage.xaml.cs, ItemDetailPage.xaml.cs, ItemsPage.xaml.cs and NewItemPage .xaml.cs these files are used to implement the layout and logic code AboutPage, ItemDetailPage, ItemsPage and NewItemPage page.
  • AppShell.xaml: Shell layout, where two labels tab bar respectively called ItemsPage and AboutPage page.
  • AppShell.xaml.cs: Shell logic code.
  • App.xaml.cs: The main page of the application to Shell.

 

Guess you like

Origin www.cnblogs.com/daxueba-ITdaren/p/11965310.html