CalciumFramework / Samples

Samples demonstrate how to use some of the features of Codon.
3 stars 2 forks source link

"Show Dialog" and "Publish Message" after "Navigate to Page 2" on Android #7

Closed abrasat closed 6 years ago

abrasat commented 6 years ago

The "Show Dialog" and "Publish Message" options work on Android as long as "Navigate to Page 2" is never selected. After navigating once to Page 2, the "Show Dialog" and "Publish Message" options dont work anymore on Android. On UWP it works fine also after navigating to page 2.

DVaughan commented 6 years ago

I just checked in a fix for that. You need to ensure that the current activity is always registered with the IoC container, otherwise some components won't function. In my apps I use a custom application lifecycle monitor to automatically do that. Alternatively you can place Dependency.Register<Activity>(this); in your activity's OnResume method.

abrasat commented 6 years ago

With the FormsNavigationService implementation of INavigationService that you sent me as FormsStarter sample ( https://github.com/CodonFramework/Samples/issues/2 ) the navigation works fine, without having to register the activity. Only the DialogService seems not to work without registering the activity. Could please post a similar implementation for IDialogService as above for INavigationService ?

DVaughan commented 6 years ago

The DialogService needs the current activity. I'm not really sure what you're asking.