コード例 #1
0
ファイル: TriPage.cs プロジェクト: nnovic/GetFacts
        public void AddArticle(Facts.AbstractInfo ai)
        {
            if (articlesCount >= 3)
            {
                throw new Exception();
            }

            ArticleDisplay ad = new ArticleDisplay(true, articlesCount);

            ad.Update(ai);
            articlesGrid.Children.Add(ad);
            //int rowNum = articlesGrid.RowDefinitions.Count;
            Grid.SetRow(ad, articlesCount);
            articlesCount++;
        }
コード例 #2
0
ファイル: SpacerPage.cs プロジェクト: nnovic/GetFacts
        public SpacerPage(Facts.Page p, Facts.Section s) : base(new GetFactsHeader())
        {
            articlesGrid = new Grid()
            {
                Margin = new System.Windows.Thickness(5)
            };

            articlesGrid.RowDefinitions.Add(new RowDefinition()
            {
                Height = new System.Windows.GridLength(1, System.Windows.GridUnitType.Star)
            });

            articlesGrid.RowDefinitions.Add(new RowDefinition()
            {
                Height = new System.Windows.GridLength(2, System.Windows.GridUnitType.Star)
            });

            _pageDisplay = new ArticleDisplay(false, 0);
            _pageDisplay.Update(p);
            articlesGrid.Children.Add(_pageDisplay);
            Grid.SetRow(_pageDisplay, 0);

            _sectionDisplay = new ArticleDisplay(false, 0);
            _sectionDisplay.Update(s);
            articlesGrid.Children.Add(_sectionDisplay);
            Grid.SetRow(_sectionDisplay, 1);

            base.Embedded = articlesGrid;
            Initialized  += SpacerPage_Initialized;
            Loaded       += SpacerPage_Loaded;

            // Note: the follwing is for debugging purpose only,
            // as no content from a disabled page should
            // ever be displayed !
            if (!p.Enabled)
            {
                Background = Brushes.Gray;
            }
        }