NotesPage.xaml.cs 806 B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using InABox.Mobile;
  4. using Xamarin.Forms;
  5. namespace comal.timesheets
  6. {
  7. public delegate void TextChangedEvent(object sender, String text);
  8. public partial class NotesPage
  9. {
  10. public TextChangedEvent TextChanged;
  11. public NotesPage(String title, String text)
  12. {
  13. InitializeComponent();
  14. var saveButton = new ToolbarItem() { Text = "Save", Command = new DropDownMenuCommand(UpdateText), Order = ToolbarItemOrder.Primary, IsEnabled = true };
  15. ToolbarItems.Add(saveButton);
  16. Title = title;
  17. Notes.Text = text;
  18. }
  19. private void UpdateText()
  20. {
  21. TextChanged?.Invoke(this, Notes.Text);
  22. Navigation.PopAsync();
  23. }
  24. }
  25. }