Example #1
0
        public DetailPage(ObservableItem item)
        {
            InitializeComponent();
            titleCell.Text       = item.Title;
            descriptionCell.Text = item.Description;

            updateButton.Clicked += (object sender, EventArgs e) =>
            {
                item.Title       = titleCell.Text;
                item.Description = descriptionCell.Text;
                ItemDatabase database = new ItemDatabase();
                database.SaveObject(item);
                Navigation.PopAsync();
            };
        }
Example #2
0
        public InsertPage()
        {
            InitializeComponent();

            insertButton.Clicked += (object sender, EventArgs e) =>
            {
                ObservableItem item = new ObservableItem
                {
                    Title       = titleCell.Text,
                    Description = descriptionCell.Text
                };

                ItemDatabase database = new ItemDatabase();
                database.SaveObject <ObservableItem>(item);
                Navigation.PopAsync();
            };
        }