예제 #1
0
        public void EmptyBootstrapPage()
        {
            // arrange
            var page = new BootstrapPage("title");

            // act
            var html = page.Render();

            // assert
            Assert.NotNull(html);
        }
예제 #2
0
        public void Demo1()
        {
            // arrange
            var page = new BootstrapPage("test",
                                         NavBar(
                                             NavBarToggler(),
                                             NavBarBrand("MyApp"),
                                             NavBarItems(
                                                 NavBarItem("Menu 1", "#", true),
                                                 NavBarItem("Menu 2", "#"),
                                                 NavBarItem("Menu 3", "#")
                                                 )
                                             ),
                                         FluidGrid(
                                             Row(
                                                 Cell(
                                                     DismissibleAlert(AlertType.Success, "Success!")
                                                     )
                                                 ),
                                             Row(
                                                 Cell(
                                                     PrimaryButton("Show Modal").OnClick(ShowModal("my-modal"))
                                                     )
                                                 )
                                             ),
                                         Footer(
                                             Span("footer").Class("text-muted")
                                             ),
                                         Modal(
                                             ModalHeader(
                                                 ModalTitle("Modal Title")
                                                 ),
                                             ModalBody(
                                                 P("Modal Body Text")
                                                 ),
                                             ModalFooter(
                                                 Button(ButtonType.Primary, "Save Changes"),
                                                 Button(ButtonType.Secondary, "Close").Attr("data-dismiss", "modal") // todo
                                                 )
                                             ).Id("my-modal")
                                         );

            // act
            var html = page.Render();

            // assert
            html.SaveToFile(".\\demo1.html");
        }
예제 #3
0
        public override void Start()
        {
            // Get a reference to the page we are managing
            BootstrapPage bootstrapPage = this.GetAttachedPage() as BootstrapPage;


            UserContext.Instance.Reset();

            bootstrapPage.OnBootstrapDidComplete = (accessToken) =>
            {
                Debug.WriteLine("Bootstrap completed.  Got access token = " + accessToken.Token);

                // Save the access token
                UserContext.Instance.AccessToken = accessToken;

                // Show the pre-login master-detail page
                Application.Current.MainPage = new PreLoginMasterDetailPage();
            };

            // Show the page
            Application.Current.MainPage = bootstrapPage;
        }
예제 #4
0
        public App()
        {
            InitializeComponent();

            MainPage = new BootstrapPage(new BootstrapCoordinator());
        }