public AddEditSpotPage(ISpotsDataService data, FavouriteSpot spot, MediaFile image)
        {
            this.image = image;
            this.spot  = spot;
            this.data  = data;

            BindingContext = spot;

            InitializeComponent();

            mainLayout.Children.Insert(0, new FavSpotView());

            SaveImageToAzureBlobStorageAsync();
        }
        public DisplaySpotsPage(ISpotsDataService data)
        {
            Data = data;

            InitializeComponent();

            if (!CrossMedia.Current.IsCameraAvailable)
            {
                ToolbarItems.Remove(takePhotoButton);
            }

            if (!CrossMedia.Current.IsPickPhotoSupported)
            {
                ToolbarItems.Remove(chooseImageButton);
            }

            this.spotList.ItemTemplate = new DataTemplate(typeof(FavSpotCell));
        }
        public App()
        {
            InitializeComponent();

            client = new MobileServiceClient(MobileServiceClientConstants.MyFavSpotAzureUrl);

            Data = new AzureSqlSpotsDataService(client);

            // Lets start with the Data Aspects of the App
            if (AuthStorage.HasLoggedIn)
            {
                // Automatically load the credentials if we have them
                AuthStorage.LoadSavedUserDetails(client);

                App.NavigateToSearchPage();
            }
            else
            {
                App.NavigateToSigninPage();
                MainPage = new SigninPage(client);
            }
        }