A2.02 Navigation aware components (Xamarin Custom User Controls) (Xamarin) - chempkovsky/CS2WPF-and-CS2XAMARIN GitHub Wiki
Two types of navigation aware components.
- As mentioned in article A1.02, there are two types of components that support navigation.
- The first type of the navigation aware components supports page navigation
- The second type of the navigation aware components implements navigation inside child window on the page
- Plese compare the "Literature\LitDialect\UserControls" and "Literature\LitDialect\Views" folders of "ModelServicesPrismModule"-project
-
This is the first type of the navigation aware components:
- LitDialectViewO2mPage.xaml
- LitDialectViewRdlistPage.xaml
- LitDialectViewReditPage.xaml
- LitDialectViewRlistPage.xaml
-
This is the second type of the navigation aware components:
- LitDialectViewO2mUserControl.xaml,
- LitDialectViewRdlistUserControl.xaml
- LitDialectViewReditUserControl.xaml
- LitDialectViewRlistUserControl.xaml
-
Here is a short explanation the difference of the two types navigation awair components:
- The ViewModels of the first type implements INavigationAware-interface (in Prism terms)
- The ViewModels of the second type implements IRegionAware-interface (in Prism terms)
First type of navigation aware components.
- RlistPage uses navigation ReditPage for Add/Update/Delete action
- RlistPage
- ReditPage
- Android app
-
RdlistPage opens dialog for Add/Update/Delete action
- RdlistPage
- EditDialog
- Android app
Second type of navigation aware components.
- RlistUserControl uses navigation ReditUserControl for Add/Update/Delete action
- RlistUserControl
- REditUserControl
- Android app
- RdlistUserControl uses dialog for Add/Update/Delete action
- RdlistUserControl
- EditDialog
- Android app
Scenarios of generating navigation aware components.
If you have not created components that support navigation, you should start with a very detailed object.
- Step 1: According to the requirements formulated by "A1.02 Navigation aware components (requirements) (Xamarin)"-article we must start with "Book"-entity.
- Step 2: you should generate navigation aware components for the direct masters of the "Book"-entity
- Step 3: you should generate navigation aware components for the direct masters of the entities of the step 2
- Step 4: you should generate navigation aware components for the direct masters of the entities of the step 3
- ...
If you have already generated components that support navigation. (This Scenario was used in our hands on lab.)
- After adding next entity to the project you should regenerate navigation aware components for the direct masters for the given entity.
Prism modules dependencies.
- Talking about non navigation aware components.
- Prism module of the detail entity depends of the module of master entity.
- Talking about navigation aware components.
- Prism module of the master entity depends of the module of detail entity
- Talking about Sform-component
- Sform-component only references "ViewService" for the given Entity