private void OnConfigureToolbar(Page page, ToolbarViewModel toolbar)
        {
            Debug.WriteLine($"Configuring toolbar on page {page.GetType()}");
            page.ToolbarItems.Clear();
            var items = toolbar.ToolbarItems.Select(tb => _toolbarItemFactory.CreateToolbarItem(tb));

            items.ForEach(i => page.ToolbarItems.Add(i));
        }
Esempio n. 2
0
        public PageViewModel(ISchedulerService scheduler)
        {
            Scheduler     = scheduler ?? throw new ArgumentNullException(nameof(scheduler));
            Title         = "Title";
            Toolbar       = new ToolbarViewModel();
            SearchBar     = new SearchBarViewModel();
            ShowSearchBar = false;
            ShowToolbar   = true;

            if (RedbridgeThemeManager.HasTheme)
            {
                NavigationBarColour     = RedbridgeThemeManager.Current.NavigationBarColour;
                NavigationBarTextColour = RedbridgeThemeManager.Current.NavigationTextColour;
            }

            AddToDisposables(RedbridgeThemeManager.Theme
                             .Where(t => t != null)
                             .ObserveOn(Scheduler.UiScheduler)
                             .Subscribe((rt) =>
            {
                NavigationBarColour     = rt.NavigationBarColour;
                NavigationBarTextColour = rt.NavigationTextColour;
            }));
        }