Guest User

Untitled

a guest
May 27th, 2018
191
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. using DryIoc;
  2. using Prism.DryIoc;
  3. using Prism.Logging;
  4. using Xamarin.Forms;
  5.  
  6. namespace PrismForms
  7. {
  8. public partial class App : PrismApplication
  9. {
  10. public static new App Current => Application.Current as App;
  11.  
  12. /// <summary>
  13. /// Logging provided by <see cref="Prism.Logging"/>
  14. /// </summary>
  15. /// <value>The logger</value>
  16. public new ILoggerFacade Logger
  17. {
  18. get { return base.Logger; }
  19. }
  20.  
  21. /// <summary>
  22. /// With Prism, we navigate using a URI format to preserve the stack. We can also
  23. /// reset or rearrage the stack by manipulating the URI, or perform "deep linking"
  24. /// when the app is launched with parameters (i.e - email link, push notification, etc)
  25. /// </summary>
  26. protected override void OnInitialized()
  27. {
  28. InitializeComponent();
  29.  
  30. NavigationService.NavigateAsync($"myapp:///Root/Navigation/{nameof(Views.HomePage)}", animated: false);
  31. }
  32.  
  33. /// <summary>
  34. /// Registers the types. Notice that we can set the name explicity by providing the
  35. /// name parameter, or just use the nameof property for the page
  36. /// </summary>
  37. protected override void RegisterTypes()
  38. {
  39. // Register Navigation page
  40. Container.RegisterTypeForNavigation<Views.AppShellNavigationPage>("Navigation");
  41.  
  42. // Register Views
  43. Container.RegisterTypeForNavigation<Views.AppShell>("Root");
  44. Container.RegisterTypeForNavigation<Views.HomePage>();
  45. Container.RegisterTypeForNavigation<Views.SamplePage>();
  46. Container.RegisterTypeForNavigation<Views.SettingsPage>();
  47. }
  48.  
  49. /* Omitted */
  50. }
Add Comment
Please, Sign In to add comment