Exemplo n.º 1
0
        private void InitSolver()
        {
            Solver = Subject.Base.Solver;
            var mstack = new StackLayout();

            Carousel  = new CarouselPage();
            _isOnMain = true;
            var solverViews = ViewHandler.GetSolverViews(Subject.Base.SubjectType);

            if (Solver == null || solverViews == null || solverViews.Count == 0)
            {
                mstack.Children.Add(new Label
                {
                    Text = "Solver not yet implemented!"
                });
            }
            else
            {
                foreach (var solverView in solverViews)
                {
                    var sv = new ScrollView
                    {
                        Content     = solverView,
                        Orientation = ScrollOrientation.Vertical
                    };
                    var tab = new ContentPage {
                        Content = sv, Title = solverView.Title
                    };
                    var btn = new Button
                    {
                        Text    = solverView.Title,
                        Command = NavigateToTabCommand(tab)
                    };
                    mstack.Children.Add(btn);
                    Carousel.Children.Add(tab);
                }
            }

            Sv.Content = mstack;
            Title      = "Solver - " + Subject.Name;
            Carousel.CurrentPageChanged += CarouselOnPageChanged;
        }