コード例 #1
0
ファイル: MainPage.xaml.cs プロジェクト: leonmeijer/MijnSauna
        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));
                }
            };
        }