Example #1
0
 SimpleBox panel; //panel 
 public TreeView(int width, int height)
     : base(width, height)
 {
     //panel for listview items
     this.panel = new SimpleBox(width, height);
     panel.ContentLayoutKind = BoxContentLayoutKind.VerticalStack;
     panel.BackColor = Color.LightGray;
     uiList = new UICollection(this);
     uiList.AddUI(panel);
 }
Example #2
0
        public ListView(int width, int height)
            : base(width, height)
        {
            uiList = new UICollection(this);
            //panel for listview items
            //
            var simpleBox = new SimpleBox(width, height);
            simpleBox.ContentLayoutKind = BoxContentLayoutKind.VerticalStack;
            simpleBox.BackColor = Color.LightGray;
            simpleBox.MouseDown += panel_MouseDown;
            simpleBox.MouseDoubleClick += panel_MouseDoubleClick;
            simpleBox.AcceptKeyboardFocus = true;
            simpleBox.KeyDown += simpleBox_KeyDown;

            this.panel = simpleBox;
            uiList.AddUI(panel);
        }
Example #3
0
        public void AddChild(UIElement ui)
        {
            if (this.uiList == null)
            {
                this.uiList = new UICollection(this);
            }

            needContentLayout = true;
            this.uiList.AddUI(ui);
            if (this.HasReadyRenderElement)
            {
                primElement.AddChild(ui);
                if (this.panelLayoutKind != BoxContentLayoutKind.Absolute)
                {
                    this.InvalidateLayout();
                }
            }

            if (ui.NeedContentLayout)
            {
                ui.InvalidateLayout();
            }
        }