示例#1
0
        public async void Init()
        {
            IsLoading = true;

            BandTheme = await personalizationManager.GetThemeAsync();

            MeTileImage = await personalizationManager.GetMeTileImageAsync();

            IsLoading = false;
        }
示例#2
0
        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();
        }
示例#3
0
        public async void Init()
        {
            BandTheme = await personalizationManager.GetThemeAsync();

            MeTileImage = await personalizationManager.GetMeTileImageAsync();
        }