| 123456789101112131415161718192021222324252627282930313233343536373839 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using Xamarin.Forms;
- using Xamarin.Forms.Xaml;
- namespace PRS.Mobile
- {
- [XamlCompilation(XamlCompilationOptions.Compile)]
- public partial class RequisitionEditNotesView : RequisitionEditView
- {
- public RequisitionEditNotesView()
- {
- InitializeComponent();
- }
- public override void Refresh()
- {
- _notes.ItemsSource = ViewModel.Item.Notes?.Where(x=>!String.IsNullOrWhiteSpace(x) && !x.StartsWith("=========")).ToArray();
- }
- public void AddNote()
- {
- NotesPage notes = new NotesPage("Add Note", "");
- notes.TextChanged += (o, text) =>
- {
- var list = ViewModel.Item.Notes?.ToList() ?? new List<string>();
- list.Add(text);
- ViewModel.Item.Notes = list.ToArray();
- ViewModel.Item.Save("");
- Refresh();
- };
- Navigation.PushAsync(notes);
- }
- }
- }
|