public void AddsChildTitleBehavior()
        {
            Xamarin.Forms.Mocks.MockForms.Init();
            var _ = new Xamarin.Forms.Application();
            IPageBehaviorFactory factory = new ExtendedPageBehaviorFactory(new DefaultPageBehaviorFactoryOptions());

            var page = new TabbedPage();

            ConfigurePage(page);
            factory.ApplyPageBehaviors(page);

            Assert.Contains(page.Behaviors, b => b.GetType() == typeof(TabbedPageChildTitleBehavior));
        }
        public void SetsUseSafeArea()
        {
            Xamarin.Forms.Mocks.MockForms.Init(Device.iOS);
            var _ = new Xamarin.Forms.Application();
            IPageBehaviorFactory factory = new ExtendedPageBehaviorFactory(new DefaultPageBehaviorFactoryOptions());

            var page = new ContentPage();

            ConfigurePage(page);
            factory.ApplyPageBehaviors(page);

            Assert.True(page.On <iOS>().UsingSafeArea());
        }
        public void SetUseBottomTabs()
        {
            Xamarin.Forms.Mocks.MockForms.Init(Device.Android);
            var _ = new Xamarin.Forms.Application();
            IPageBehaviorFactory factory = new ExtendedPageBehaviorFactory(new DefaultPageBehaviorFactoryOptions());

            var page = new TabbedPage();

            ConfigurePage(page);
            factory.ApplyPageBehaviors(page);

            Assert.Equal(ToolbarPlacement.Bottom, AndroidTabbedPage.GetToolbarPlacement(page));
        }
        public void SetsPreferLargeTitles()
        {
            Xamarin.Forms.Mocks.MockForms.Init(Device.iOS);
            var _ = new Xamarin.Forms.Application();
            IPageBehaviorFactory factory = new ExtendedPageBehaviorFactory(new DefaultPageBehaviorFactoryOptions());

            var page = new NavigationPage();

            ConfigurePage(page);
            factory.ApplyPageBehaviors(page);

            Assert.True(page.On <iOS>().PrefersLargeTitles());
        }
        public void SetsTitleBinding()
        {
            Xamarin.Forms.Mocks.MockForms.Init();
            var _ = new Xamarin.Forms.Application();
            IPageBehaviorFactory factory = new ExtendedPageBehaviorFactory(new DefaultPageBehaviorFactoryOptions());

            var page = new TabbedPage
            {
                BindingContext = new DefaultViewModel()
            };

            ConfigurePage(page);
            factory.ApplyPageBehaviors(page);

            Assert.True(page.IsSet(Xamarin.Forms.Page.TitleProperty));
        }