Passing information into Rhino.UI.Panel

Thanks, It worked now, although it is kinda ‘hacky’. Can you give me any suggestion on my current approach:

  • algorithm calculate colorDict
  • colorDict is passed into a Singleton(basically a list of calculated number) called session
  • create a custom Eto.Forms.Panel class, whose contain a private variable pointing to session.
  • In the init function, pass session into an EtoCollapsibleSection class, as shown below.
        public ColorScalePanel()
        {
            EtoCollapsibleSectionHolder holder = new EtoCollapsibleSectionHolder();
            ColorScaleSection section1 = new ColorScaleSection(session.depthColorDict);
            holder.Add(section1);
            TableLayout tableLayout = new TableLayout()
            {
                Rows =
                {
                    holder
                }
            };
            Content = tableLayout;
        }

Afaik, this is basically pointing straight from the “view” Eto.Forms.Panel to the “model” session, meaning, there isn’t any “viewModel”’ as all.
Further down the line, If I wanna include the “viewModel”, are the event logics be coded in here ?

Also, I have another problem regarding Eto.Forms.Label, as shown here.