A3.02 FeatureScripts Wizard (Xamarin) - chempkovsky/CS2WPF-and-CS2XAMARIN GitHub Wiki

With FeatureSripts Wizard, a developer can model and generate pages with one or more **child **tabular forms. Any child form can support routing!!! Let's create a pair of Feature-components

  • Preparation Steps
    • create "Literature\Literature\Ftr01\ViewModels" folder of FeatureServicesPrismModule-project
    • create "Literature\Literature\Ftr01\Views" folder of FeatureServicesPrismModule-project

picture

  • Right click "Literature\Literature\Ftr01\Views" folder of FeatureServicesPrismModule-project and run FeatureSripts Wizard

picture

  • On the first page the destination folder is shown
  • click Next-button

picture

  • On the second page
    • select "LitDbContext"
  • click Next-button

picture

  • On the third page
  • click Add-button

picture

  • In the dialog
    • enter "Ftr01"
    • check Four items: [Genre, Edition, Country, Language] for 01918
    • click Save-button

picture

  • We are on the third page again
    • Select "Ftr01"
    • Click "Next"-button

picture

  • On the fourth page
    • Select "30100-FtrUserControl.xaml.cs"
    • Click "Next"-button

picture

  • On the fifth page
    • Select "30100-FtrUserControl.Xamarin.xaml.cs.t4"
    • Click "Next"-button

picture

  • On the sixth page
    • Click "Save"-button
    • After Save click "Next"-button

picture

  • We are on the third page again
    • Select "Ftr01"
    • Click "Next"-button

picture

  • On the fourth page
    • Select "30100-FtrUserControl.xaml.cs"
    • Click "Next"-button

picture

  • On the fifth page
    • Select "FtrUserControl.Xamarin.xaml.t4"
    • Click "Next"-button

picture

  • On the sixth page

    • Click "Save"-button
    • After Save click "Cancel"-button
  • Right click "Literature\Literature\Ftr01\ViewModels" folder of FeatureServicesPrismModule-project and run FeatureSripts Wizard

picture

  • repeat the same steps until third page
    • on the third page again
      • Select "Ftr01"
      • Click "Next"-button

picture

  • On the fourth page
    • Select "30100-FtrViewModel.cs"
    • Click "Next"-button

picture

  • On the fifth page
    • Select "FtrViewModel.Xamarin.cs.t4"
    • Click "Next"-button

picture

  • On the sixth page

    • Click "Save"-button
    • Click "Next"-button
    • Click "Next"-button again
  • On the fourth page

    • Select "30104-FtrViewModel.PrismModuleModifier.txt"
    • Click "Next"-button
  • On the fifth page

    • Select "FtrViewModel.PrismModuleModifier.Xamarin.txt.t4"
    • Click "Next"-button
  • On the sixth page

    • Click "Save"-button
    • Click "Cancel"-button
  • Under FeatureServicesPrismModule-project the RegisterTypes()-method of the FeatureServicesPrismModuleModule.cs becomes as follows

        public void RegisterTypes(IContainerRegistry containerRegistry)
        {

            Prism.Mvvm.ViewModelLocationProvider.Register<FeatureServicesPrismModule.Literature.Ftr01.Views.Ftr01FtrUserControl, FeatureServicesPrismModule.Literature.Ftr01.ViewModels.Ftr01FtrViewModel>();
            containerRegistry.RegisterForNavigation<FeatureServicesPrismModule.Literature.Ftr01.Views.Ftr01FtrUserControl, FeatureServicesPrismModule.Literature.Ftr01.ViewModels.Ftr01FtrViewModel>("Ftr01FtrUserControl");
        }

We need only the name "Ftr01FtrUserControl"

  • Open "Views\MainFlyoutPage.xaml"-file of the PrismDemoApp-project
  • Modify content of StackLayout as shown:
...
                    <Label Text="Features"/>
                    <Button BackgroundColor="Transparent"  Text="Master Entities R forms"  Command="{Binding NavigateCommand}" CommandParameter="Ftr01FtrUserControl" />

Repeat All the steps above to create the second feature with a name "Ftr2" and "02018"-type

picture

...

  • Open "Views\MainFlyoutPage.xaml"-file of the PrismDemoApp-project
  • Modify content of StackLayout as shown:
...
                    <Label Text="Features"/>
                    <Button BackgroundColor="Transparent"  Text="Master Entities R forms"  Command="{Binding NavigateCommand}" CommandParameter="Ftr01FtrUserControl" />
                    <Button BackgroundColor="Transparent"  Text="Master Entities Rd Forms"  Command="{Binding NavigateCommand}" CommandParameter="Ftr2FtrUserControl" />

  • Android app

picture

  • Android app

picture