Exemple #1
0
        protected override void loadTemplate(GraphicObject template = null)
        {
            base.loadTemplate (template);

            items = this.child.FindByName ("ItemsContainer") as Group;
            if (items == null)
                throw new Exception ("TemplatedGroup template Must contain a Group named 'ItemsContainer'");
            if (items.Children.Count == 0)
                NotifyValueChanged ("HasChildren", false);
            else
                NotifyValueChanged ("HasChildren", true);
        }
Exemple #2
0
        protected void loadItem(int i, Group page)
        {
            GraphicObject g = null;
            ItemTemplate iTemp = null;
            Type dataType = data [i].GetType ();
            string itempKey = dataType.FullName;

            if (_dataTest != "TypeOf")
                itempKey = getItempKey (dataType, data [i]);

            if (ItemTemplates.ContainsKey (itempKey))
                    iTemp = ItemTemplates [itempKey];
            else
                iTemp = ItemTemplates ["default"];

            lock (CurrentInterface.LayoutMutex) {
                g = iTemp.CreateInstance(CurrentInterface);
                page.AddChild (g);
                //g.LogicalParent = this;
                registerItemClick (g);
            }

            if (iTemp.Expand != null && g is Expandable) {
                (g as Expandable).Expand += iTemp.Expand;
                (g as Expandable).GetIsExpandable = iTemp.HasSubItems;
            }

            g.DataSource = data [i];
        }