LogViewer.xaml.cs 882 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using Xamarin.Essentials;
  4. using Xamarin.Forms.Xaml;
  5. namespace PRS.Mobile
  6. {
  7. [XamlCompilation(XamlCompilationOptions.Compile)]
  8. public partial class LogViewer
  9. {
  10. public LogViewer()
  11. {
  12. InitializeComponent();
  13. }
  14. protected override void OnAppearing()
  15. {
  16. base.OnAppearing();
  17. Log.Text = InABox.Mobile.MobileLogging.ReadLog();
  18. }
  19. private async void Email_OnClicked(object sender, EventArgs e)
  20. {
  21. var message = new EmailMessage
  22. {
  23. Subject = $@"PRS Mobile LogFiles",
  24. Body = InABox.Mobile.MobileLogging.ReadLog(),
  25. To = new List<string> { "support@prsdigital.com.au" }
  26. };
  27. await Email.ComposeAsync(message);
  28. }
  29. }
  30. }