Esempio n. 1
0
        public MainPage(MainPageViewModel vm, IStatusBarService statusBarService)
        {
            InitializeComponent();
            BindingContext = vm;

            vm.PropertyChanged += async(o, args) =>
            {
                if (args.PropertyName == nameof(vm.SessionState))
                {
                    await statusBarService.SetStatusBarColorFromArgb(
                        (int)(BackgroundColor.A * 255),
                        (int)(BackgroundColor.R * 255),
                        (int)(BackgroundColor.G * 255),
                        (int)(BackgroundColor.B * 255));
                }
            };
        }