PopupEditor.xaml.cs 775 B

123456789101112131415161718192021222324252627282930313233343536
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using Xamarin.Forms;
  7. using Xamarin.Forms.Xaml;
  8. namespace PRS.Mobile
  9. {
  10. public delegate void PopupEditorSaved(string text);
  11. [XamlCompilation(XamlCompilationOptions.Compile)]
  12. public partial class PopupEditor
  13. {
  14. public event PopupEditorSaved OnPopupEdtSaved;
  15. public PopupEditor(string text = "")
  16. {
  17. InitializeComponent();
  18. NavigationPage.SetHasBackButton(this, false);
  19. textEdt.Text = text;
  20. }
  21. private void CancelBtn_Clicked(object sender, EventArgs e)
  22. {
  23. Navigation.PopAsync();
  24. }
  25. private void SaveBtn_Clicked(object sender, EventArgs e)
  26. {
  27. OnPopupEdtSaved(textEdt.Text);
  28. Navigation.PopAsync();
  29. }
  30. }
  31. }