Пример #1
0
        protected override UIControl NextControl()
        {
            var criterion = SourceList[NextIndex] as Criterion;
            var control   = new UICriterion(3);

            control.IsStatic        = true;
            control.AdvancementName = criterion.ParentID;
            control.CriterionName   = criterion.ID;
            return(control);
        }
Пример #2
0
        public override void InitializeRecursive(Screen screen)
        {
            if (TrackerSettings.IsPostExplorationUpdate)
            {
                advancement = screen.AdvancementTracker.Advancement(AdvancementName);
            }
            else
            {
                advancement = screen.AchievementTracker.Achievement(AdvancementName);
            }
            if (advancement == null)
            {
                return;
            }

            goalName = advancement.CriteriaGoal;

            var adv = GetFirstOfType(typeof(UIAdvancement), true) as UIAdvancement;

            if (adv != null)
            {
                adv.AdvancementName = AdvancementName;
            }

            var flow = GetFirstOfType(typeof(UIFlowPanel), true) as UIFlowPanel;

            if (flow != null)
            {
                foreach (var criterion in advancement.Criteria)
                {
                    var crit = new UICriterion();
                    crit.AdvancementName = AdvancementName;
                    crit.CriterionName   = criterion.Key;
                    flow.AddControl(crit);
                }
            }

            label = GetControlByName("progress", true) as UITextBlock;
            bar   = GetControlByName("bar", true) as UIProgressBar;
            bar?.SetMax(advancement.Criteria.Count);

            base.InitializeRecursive(screen);
        }