Exemplo n.º 1
0
        public DisplayLocationDetailsPage(FavouriteSpot spot)
        {
            this.spot      = spot;
            BindingContext = spot;

            InitializeComponent();

            mainLayout.Children.Insert(0, new FavSpotView());
        }
        public async Task <bool> SaveFavoriteSpotAsync(FavouriteSpot spot)
        {
            await Initialize();

            if (string.IsNullOrEmpty(spot.Id))
            {
                await favouriteSpotsTable.InsertAsync(spot);
            }
            else
            {
                await favouriteSpotsTable.UpdateAsync(spot);
            }

            await SynchronizeAsync();

            return(true);
        }