A3.01 FeatureScripts Wizard (Manuscript) (Wpf) - 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 for the Manuscript-View

  • Preparation Steps
    • create "Literature\LitManuscript\UserControls" folder of FeatureServicesPrismModule-project
  • Right click "Literature\LitManuscript\UserControls" 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 "ManuscriptRFeature"
    • check three items for LitManuscriptView: 01598, 01918 and 02018
    • click Save-button

picture

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

picture

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

picture

  • On the fifth page
    • Select "30100-FtrUserControl.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 "ManuscriptRFeature"
    • Click "Next"-button

picture

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

picture

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

picture

  • On the sixth page

    • Click "Save"-button
    • After Save click "Cancel"-button
  • Preparation Steps

    • create "Literature\LitManuscript\ViewModels" folder of FeatureServicesPrismModule-project
  • Right click "Literature\LitManuscript\ViewModels" folder of FeatureServicesPrismModule-project and run FeatureSripts Wizard

  • On the first page the destination folder is shown

  • click Next-button

  • On the second page

    • select "LitDbContext"
  • click Next-button

picture

  • On the third page
    • Select "ManuscriptRFeature"
    • Click "Next"-button

picture

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

picture

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

picture

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

Open the file Literature\LitManuscript\ViewModels\ManuscriptRFeatureFtrViewModel.cs of the FeatureServicesPrismModule-project and follow the instruction at the beginning of the file.

  • Under FeatureServicesPrismModule-project the RegisterTypes()-method of the FeatureServicesPrismModuleModule.cs becomes as follows
public void RegisterTypes(IContainerRegistry containerRegistry)
{
  // According to requirements of the "ManuscriptRFeatureFtrViewModel.cs"-file of "FeatureServicesPrismModule"-project. 
  containerRegistry.RegisterForNavigation<ManuscriptRFeatureFtrUserControl, ManuscriptRFeatureFtrViewModel>("ManuscriptRFeatureFtrUserControl");
}
  • Open "ViewModels\MainWindowViewModel.cs"-file of the PrismDemoApp-project
  • Modify _MainMenu variable as shown
IEnumerable<IWebServiceFilterMenuInterface> _MainMenu = new ObservableCollection<IWebServiceFilterMenuInterface>()
{
  new WebServiceFilterMenuViewModel() { Id = "000", Caption="Home", IconName="Home",  IconColor="Primary", Data="HomeUserControl", Command=RoutedCommandExt.MainMenuCommand},
  new WebServiceFilterMenuViewModel() { Id = "001", Caption="LitGenre Lform", IconName="TableRefresh",  IconColor="Primary", Data="LitGenreViewLformUserControl", Command=RoutedCommandExt.MainMenuCommand},
  new WebServiceFilterMenuViewModel() { Id = "001", Caption="LitEdition Lform", IconName="TableRefresh",  IconColor="Primary", Data="LitEditionViewLformUserControl", Command=RoutedCommandExt.MainMenuCommand},
  new WebServiceFilterMenuViewModel() { Id = "001", Caption="Country Lform", IconName="TableRefresh",  IconColor="Primary", Data="LitCountryViewLformUserControl", Command=RoutedCommandExt.MainMenuCommand},
  new WebServiceFilterMenuViewModel() { Id = "001", Caption="Language Lform", IconName="TableRefresh",  IconColor="Primary", Data="LitLanguageViewLformUserControl", Command=RoutedCommandExt.MainMenuCommand},
  new WebServiceFilterMenuViewModel() { Id = "001", Caption="Dialect Lform", IconName="TableRefresh",  IconColor="Primary", Data="LitDialectViewLformUserControl", Command=RoutedCommandExt.MainMenuCommand},
  new WebServiceFilterMenuViewModel() { Id = "001", Caption="Publisher Lform", IconName="TableRefresh",  IconColor="Primary", Data="LitPublisherViewLformUserControl", Command=RoutedCommandExt.MainMenuCommand},
  new WebServiceFilterMenuViewModel() { Id = "001", Caption="Manuscript Lform", IconName="TableRefresh",  IconColor="Primary", Data="LitManuscriptViewLformUserControl", Command=RoutedCommandExt.MainMenuCommand},
  new WebServiceFilterMenuViewModel() { Id = "001", Caption = "Book Rlist", IconName = "TableRefresh",  IconColor = "Primary", Data = "LitBookViewRlistUserControl", Command = RoutedCommandExt.MainMenuCommand},
  new WebServiceFilterMenuViewModel() { Id = "001", Caption = "Book Rdlist", IconName = "TableRefresh",  IconColor = "Primary", Data = "LitBookViewRdlistUserControl", Command = RoutedCommandExt.MainMenuCommand},
  new WebServiceFilterMenuViewModel() { Id = "001", Caption = "Manuscript Rlist", IconName = "TableRefresh",  IconColor = "Primary", Data = "LitManuscriptViewRlistUserControl", Command = RoutedCommandExt.MainMenuCommand},
  new WebServiceFilterMenuViewModel() { Id = "001", Caption = "Manuscript Rdlist", IconName = "TableRefresh",  IconColor = "Primary", Data = "LitManuscriptViewRdlistUserControl", Command = RoutedCommandExt.MainMenuCommand},

  new WebServiceFilterMenuViewModel() { Id = "001", Caption = "Manuscript RFeature", IconName = "TableRefresh",  IconColor = "Primary", Data = "ManuscriptRFeatureFtrUserControl", Command = RoutedCommandExt.MainMenuCommand},
};

Modify App.config of PrismDemoApp-module as follows:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
    <section name="modules" type="Prism.Modularity.ModulesConfigurationSection, Prism.Wpf"/>
  </configSections>
  <modules>
    <module assemblyFile="CommonServicesPrismModule.dll"
            moduleType="CommonServicesPrismModule.CommonServicesPrismModuleModule, CommonServicesPrismModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            moduleName="CommonServicesPrismModule" startupLoaded="true">
      <dependencies>
      </dependencies>
    </module>
    <module assemblyFile="ModelServicesPrismModule.dll"
            moduleType="ModelServicesPrismModule.ModelServicesPrismModuleModule, ModelServicesPrismModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            moduleName="ModelServicesPrismModule" startupLoaded="true">
      <dependencies>
        <dependency moduleName="CommonServicesPrismModule"/>
      </dependencies>
    </module>
    <module assemblyFile="FeatureServicesPrismModule.dll"
            moduleType="FeatureServicesPrismModule.FeatureServicesPrismModuleModule, FeatureServicesPrismModule, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null"
            moduleName="FeatureServicesPrismModule" startupLoaded="true">
      <dependencies>
        <dependency moduleName="ModelServicesPrismModule"/>
      </dependencies>
    </module>
  </modules>
</configuration>	

rebuild

ModelInterfacesClassLibrary FeatureServicesPrismModule PrismDemoApp run Dm04WebApp run PrismDemoApp

click "Manuscript RFeature"-navigation menu item. Here is a result

picture

⚠️ **GitHub.com Fallback** ⚠️