Skip to content

Instantly share code, notes, and snippets.

@olafloogman
Created January 14, 2015 02:58
Show Gist options
  • Save olafloogman/8768564e6686601c9c9e to your computer and use it in GitHub Desktop.
Save olafloogman/8768564e6686601c9c9e to your computer and use it in GitHub Desktop.
ColorDataToMobileService
private async void lstColor_SelectionChanged(object sender, SelectionChangedEventArgs e)
{
if (e.AddedItems.Count > 0)
{
(Application.Current as App).CurrentColorItem = ((ColorItem)e.AddedItems[0]);
var Color = ((ColorItem)e.AddedItems[0]).Color;
SensorData item = new SensorData
{
DeviceId = "PhoneEmulator",
SensorId = "ColorPicker",
EventType = "RGB",
EventData = string.Format("{0};{1};{2}", Color.R, Color.G, Color.B)
};
await App.MobileService.GetTable<SensorData>().InsertAsync(item);
this.NavigationService.GoBack();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment