51.02 Add Dialect to navigation bar (Xamarin) - chempkovsky/CS2WPF-and-CS2XAMARIN GitHub Wiki
- Open "Views\MainFlyoutPage.xaml"-file of the PrismDemoApp-project
- Modify content of StackLayout as shown:
<StackLayout Padding="20" >
...
<Label Text="Dialect"/>
<Button BackgroundColor="Transparent" Text="L Dialog" Command="{Binding ShowDialogCommand}" CommandParameter="LitDialectViewLdlgViewModel" />
<Button BackgroundColor="Transparent" Text="R Page" Command="{Binding NavigateCommand}" CommandParameter="LitDialectViewRlistPage" />
<Button BackgroundColor="Transparent" Text="Rd Page" Command="{Binding NavigateCommand}" CommandParameter="LitDialectViewRdlistPage" />
<Button BackgroundColor="Transparent" Text="O2m Page" Command="{Binding NavigateCommand}" CommandParameter="LitDialectViewO2mPage" />
</StackLayout>
Note
- Here is how to get CommandParameters like [CommandParameter="LitDialectViewO2mPage"]
- Under ModelServicesPrismModule-project navigate to RegisterTypes()-method of the ModelServicesPrismModuleModule.cs
public void RegisterTypes(IContainerRegistry containerRegistry)
{
containerRegistry.RegisterForRegionNavigation<ModelServicesPrismModule.Literature.LitDialect.UserControls.LitDialectViewO2mUserControl, ModelServicesPrismModule.Literature.LitDialect.ViewModels.LitDialectViewO2mViewModel>("LitDialectViewO2mUserControl");
...
containerRegistry.RegisterForRegionNavigation<ModelServicesPrismModule.Literature.LitDialect.UserControls.LitDialectViewReditUserControl, ModelServicesPrismModule.Literature.LitDialect.ViewModels.LitDialectViewReditViewModel>("LitDialectViewReditUserControl");
...
containerRegistry.RegisterForRegionNavigation<ModelServicesPrismModule.Literature.LitDialect.UserControls.LitDialectViewRlistUserControl, ModelServicesPrismModule.Literature.LitDialect.ViewModels.LitDialectViewRlistViewModel>("LitDialectViewRlistUserControl");
...
containerRegistry.RegisterForRegionNavigation<ModelServicesPrismModule.Literature.LitDialect.UserControls.LitDialectViewRdlistUserControl, ModelServicesPrismModule.Literature.LitDialect.ViewModels.LitDialectViewRdlistViewModel>("LitDialectViewRdlistUserControl");
...
}
Look for "containerRegistry.RegisterForRegionNavigation" with "...LitDialect...".
Rebuild
- rebuild
- PrismDemoApp
- run PrismDemoApp.Android
- In the app click "R Page"-menu item of "Country"-block and add a pair of records
or UWP
and