コード例 #1
0
 private void Pager_SlideChanged(object sender, EventArgs e)
 {
     banner.Caption = Caption.Financial(Pager.CurrentSlideNumber);
 }
コード例 #2
0
        public void ReadyContent()
        {
            var part        = NavigationManager.GetQueryString("part");
            int slide       = 0;
            var slideString = NavigationManager.GetQueryString("slide");

            if (slideString != string.Empty)
            {
                slide = Convert.ToInt32(slideString);
            }
            int id       = 0;
            var idString = NavigationManager.GetQueryString("id");

            if (idString != string.Empty)
            {
                id = Convert.ToInt32(idString);
            }

            if (part == "city")
            {
                RichCityPage richPage = new RichCityPage();
                this.Pager.Slides.Clear();
                richPage.GetPages().ForEach(x => this.Pager.Slides.Add(x));
                Pager.Slides.RemoveAt(Pager.Slides.Count - 1); // 去掉最后一个
                // 问卷
                QuestionPage page = new QuestionPage();
                Pager.Slides.Add(page.GetContent("city", 0));
                Pager.NavBar.PointDescripions = Enumerable.Range(0, Pager.Slides.Count).Select(x => Caption.City(x)).ToList();
                this.Pager.ReadyControl(slide);
            }
            else if (part == "financial")
            {
                RichFinancialPage richPage = new RichFinancialPage();
                this.Pager.Slides.Clear();
                richPage.GetPages().ForEach(x => this.Pager.Slides.Add(x));
                Pager.Slides.RemoveAt(Pager.Slides.Count - 1); // 去掉最后一个
                Pager.NavBar.PointDescripions = Enumerable.Range(0, Pager.Slides.Count).Select(x => Caption.Financial(x)).ToList();
                this.Pager.ReadyControl(slide);
            }
            else if (part == "project")
            {
                RichProjectPage richPage = new RichProjectPage();
                richPage.SetProj(id);
                this.Pager.Slides.Clear();
                richPage.GetPages().ForEach(x => this.Pager.Slides.Add(x));
                Pager.Slides.RemoveAt(Pager.Slides.Count - 1); // 去掉最后一个
                Pager.NavBar.PointDescripions = Enumerable.Range(0, Pager.Slides.Count).Select(x => Caption.Project(x)).ToList();
                this.Pager.ReadyControl(slide);
            }
            else if (part == "pip")
            {
                PipPage richPage = new PipPage();
                this.Pager.Slides.Clear();
                richPage.Update().ForEach(x => this.Pager.Slides.Add(x));
                Pager.NavBar.PointDescripions = Enumerable.Range(0, Pager.Slides.Count).Select(x => Caption.Pip(x)).ToList();
                this.Pager.ReadyControl(slide);
            }
            //else if (part == "city_q")
            //{
            //    QuestionPage page = new QuestionPage();
            //    this.Pager.Slides.Clear();
            //    this.Pager.Slides.Add(page.GetContent("city", 0));
            //    this.Pager.ReadyControl(0);
            //}
            //else if (part == "project_q")
            //{
            //    QuestionPage page = new QuestionPage();
            //    this.Pager.Slides.Clear();
            //    this.Pager.Slides.Add(page.GetContent("project", id));
            //    this.Pager.ReadyControl(0);
            //}
            else if (part == "summary")
            {
                SummaryPage page = new SummaryPage();
                page.Update();
                var content = page.LayoutRoot;
                content.Children.RemoveAt(0);
                content.Children.RemoveAt(content.Children.Count - 2);
                page.grid1.Children.Remove(content);
                this.Pager.Slides.Clear();
                this.Pager.Slides.Add(content);
                this.Pager.ReadyControl(0);
            }
            else if (part == "about")
            {
                AboutPage ap = new AboutPage();
                this.Pager.Slides.Clear();
                this.Pager.Slides.Add(ap);
                this.Pager.ReadyControl(0);
            }
        }
コード例 #3
0
        private void Page_Loaded(object sender, RoutedEventArgs e)
        {
            var slideString = NavigationManager.GetQueryString("slide");

            if (slideString != string.Empty)
            {
                _slidePos = Convert.ToInt32(slideString);
            }

            GetPages().ForEach(x => Pager.Slides.Add(x));
            Pager.NavBar.PointDescripions = Enumerable.Range(0, Pager.Slides.Count).Select(x => Caption.Financial(x)).ToList();
            Pager.ReadyControl(_slidePos);
        }