Skip to content

Instantly share code, notes, and snippets.

@hminaya
Last active May 26, 2017 16:19
Show Gist options
  • Save hminaya/0ff856ef95769fb064174c420d34f5bc to your computer and use it in GitHub Desktop.
Save hminaya/0ff856ef95769fb064174c420d34f5bc to your computer and use it in GitHub Desktop.
Requirements

Diplomado Xamarin - Day4

Lab Exercise

Initial Setup

Github

  • Clone (or download) the repository from https://github.com/hminaya/DiplomadoMSDay4
  • Open with Xamarin Studio on the MAC or Visual Studio on Windows
  • Right click on the Solution name, Clean, Restore Nuget Packages, Rebuild (make sure you are connected to the internet)
  • Run the app on a Simulator or Device
  • It should display the Customer Dashboard

Customer.cs

  • Make sure the table name matches what is in the JsonObject title property, if not change it
  • Make sure the column names match the JsonProperty tags, if not, change them

Activity Indicator

MainPage.xaml

  • Add an Activity Indicator below the buttons

MainPageViewModel.cs

  • Create the properties that the Activity Indicator will bind to
  • Set those properties in the OnSave() method
  • Set those properties in the OnSync() method

Notification

GcmService.cs

  • Change the notification title to "New Customer has been Registered"
  • Change the notification description to "Welcome [customer_name]."
  • Print out to the console all of the other keys/values that are passed in the intent.Extras collection

Validations

MainPageViewModel.cs

  • Make sure the Name and Email properties are not empty before saving
  • If they are empty display an Alert message so the user knows what is wrong

Delete Customers

AzureService.cs

  • Add a method to delete all Customers

MainPage.xaml

  • Add a new button with the text "Delete All Customers"

MainPageViewModel.cs

  • Bind the previous buttons to a new command
  • Call the new Delete method in the AzureService
  • Display an alert when it has finished deleting
  • Make sure to refresh the ListView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment