-
-
Save ztirom/2a923390458d34e45e0b67b4ce4ac49d to your computer and use it in GitHub Desktop.
First steps with Xamarin and the Microsoft Band SDK
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Band { | |
private static Band BandDevice; | |
public BandClient BandClient { get; set; } | |
public String Name { get; set; } | |
private Band() { | |
} | |
private async void PairBand() { | |
var bandClientManager = BandClientManager.Instance; | |
var bandsFound = await bandClientManager.GetPairedBandsAsync(); | |
if (bandsFound != null && bandsFound.Count() == 1) | |
{ | |
var bandFound = bandsFound.FirstOrDefault(); | |
BandDevice.BandClient = await bandClientManager.ConnectAsync(bandFound); | |
BandDevice.Name = bandFound.Name; | |
} | |
} | |
public static Band Instance { | |
get { | |
if (BandDevice == null) | |
{ | |
BandDevice = new Band(); | |
} | |
return BandDevice; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment