public SectionConcept(T Target, IHTMLImage TreeExpand, IHTMLImage TreeCollapse) { this.Target = Target; Content = new IHTMLDiv { Target.Content.childNodes }; Header = new IHTMLSpan { Target.Header.childNodes }; var Icon = new IHTMLSpan { TreeExpand, TreeCollapse }; Icon.style.marginRight = "1em"; Icon.AttachTo(Target.Header); Header.AttachTo(Target.Header); Content.AttachTo(Target.Content); Target.Header.style.cursor = ScriptCoreLib.JavaScript.DOM.IStyle.CursorEnum.pointer; TreeExpand.Hide(); Action onclick = delegate { }; Target.Header.onclick += delegate { onclick(); }; this.NextClickHide = delegate { InternalIsExpanded = false; Target.Content.Hide(); TreeExpand.Show(); TreeCollapse.Hide(); onclick = NextClickShow; }; this.NextClickShow = delegate { InternalIsExpanded = true; Target.Content.Show(); TreeExpand.Hide(); TreeCollapse.Show(); onclick = NextClickHide; }; onclick = NextClickHide; }