public PersonalizationViewModel(BandDeviceInfo info, BandClient bandClient) : base(info, bandClient) { personalizationManager = bandClient.PersonalizationManager; GetBandThemeCommand = new Command(async() => { BandTheme = await personalizationManager.GetThemeAsync(); }); DefaultBandThemeCommand = new Command(() => { BandTheme = App.DefaultTheme; }); SetBandThemeCommand = new Command(async() => { await personalizationManager.SetThemeAsync(BandTheme); }); GetMeTileImageCommand = new Command(async() => { MeTileImage = await personalizationManager.GetMeTileImageAsync(); }); DefaultMeTileImageCommand = new Command(async() => { MeTileImage = await App.LoadImageResourceAsync("Resources/metile.png"); }); SelectMeTileImageCommand = new Command(async() => { var photo = await CrossMedia.Current.PickPhotoAsync(); if (photo != null) { MeTileImage = await BandImage.FromStreamAsync(photo.GetStream()); } }, () => CrossMedia.Current.IsPickPhotoSupported); SetMeTileImageCommand = new Command(async() => { await personalizationManager.SetMeTileImageAsync(MeTileImage); }); Init(); }
private async Task SetMyTilemmandExecute() { await _personalizationManager.SetMeTileImageAsync(MeTileImage); }