LogViewer.xaml.cs 1013 B

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