Exemplo n.º 1
0
        public MajorsPage(MajorsContext majorsContext, AppConfig appConfig, Window window)
        {
            InitializeComponent();
            _majorsContext = majorsContext;
            _appConfig     = appConfig;
            _window        = window;
            var majorsGrid = this.MajorsGrid;

            PrepareGrid(majorsGrid, this._majorsContext.MajorInfos, true);
            PrepareGrid(this.ToolsGrid, this._majorsContext.ResourceInfos, false);

            var backgroundImagePath = appConfig.GetAppBackgroundImagePath();

            if (!string.IsNullOrWhiteSpace(backgroundImagePath))
            {
                GridUtility.SetBackGround(backgroundImagePath, MainGrid);
            }
            else
            {
                GridUtility.SetBackGround(_majorsContext.TopBackgroundImagePath, TopGrid);
                GridUtility.SetBackGround(_majorsContext.BottomBackgroundImagePath, BottomGrid);
            }


            if (!string.IsNullOrWhiteSpace(_majorsContext.AppTitle))
            {
                this.WindowTitle = _majorsContext.AppTitle;
                this.Title       = _majorsContext.AppTitle;
            }

            BarPageUtility.PrepareBarPage(this, _appConfig);
        }
Exemplo n.º 2
0
        public MajorPage(MajorContext majorContext, AppConfig appConfig, Window window)
        {
            _majorContext = majorContext;
            _appConfig    = appConfig;
            _window       = window;
            InitializeComponent();
            PrepareGrid();
            PrepareGrid(this.ToolsGrid, this._majorContext.ResourceInfos);
            var majorBackgroundImagePath = appConfig.GetMajorBackgroundImagePath(_majorContext.MajorName);

            if (!string.IsNullOrWhiteSpace(majorBackgroundImagePath))
            {
                GridUtility.SetBackGround(majorBackgroundImagePath, MainGrid);
            }
            else
            {
                GridUtility.SetBackGround(_majorContext.TopBackgroundImagePath, TopGrid);
                GridUtility.SetBackGround(_majorContext.BottomBackgroundImagePath, BottomGrid);
            }

            if (!string.IsNullOrWhiteSpace(_majorContext.MajorName) && appConfig.ShowMajorNameAtMajorPage)
            {
                Title = _majorContext.MajorName;
                var textBlock = new TextBlock
                {
                    Text = _majorContext.MajorName
                };
                PageTitleViewBox.Child = textBlock;
            }

            BarPageUtility.PrepareBarPage(this, _appConfig);
        }