My Project:
MyAppB (External Shared Project)
- includes multiple views (xaml files) which extends from ContentPage
- uses e.g. await Navigation.PushAsync(new Chat());
MyApplicationA (Code Sharing - .NET Standard 2.0)
- is build with prism framework (Model-View-ViewModel)
- uses e.g. await NavigationService.NavigateAsync("name", parameters);
MyApplicationA.Android
- references both (MyApplicationA and MyAppB) -> Is this correct?
MyApplicationA.iOS
- references both (MyApplicationA and MyAppB) -> Is this correct?
My Goal: I want to navigate from a view or viewmodel in MyApplicationA to a view in MyAppB.
Fortunatly navigating to a view in MyAppB from a viewmodel in MyApplicationA is working.
I'm using a interface definition in MyApplicationA and calls it in the viewmodel. The interface is implemented in the MyApplicationA.Android and MyApplicationA.iOS.
WORKS: To navigate i use: App.Current.MainPage = new NavigationPage(new MainPage(screenCaptureIntent));
// (the intent is the reason why i have to navigate from MyApplicationA to MyApplicationA.Android and then to MyAppB)
DONT WORK: Using await App.Current.MainPage.Navigation.PushAsync(new MainPage(screenCaptureIntent));
is not working and gives the following error:
PushAsync is not supported globally on Android, please use a NavigationPage.
But i have problems to go back from the view in MyAppB to the application in MyApplicationA e.g. a view which loads data, in best case it would be the last page in the navigation stack...
Does someone have a hint for me how to solve this? Am I doing it the right way? Or can i reference MyAppB in MyApplicationA - but what happens to the device specific code e.g. #if __IOS__
Thx Daniel