rds1983 / Myra

UI Library for MonoGame, FNA and Stride
MIT License
704 stars 94 forks source link

Layout not up-to-date when building uis via code #377

Open IceReaper opened 1 year ago

IceReaper commented 1 year ago

Example: tabs.

  1. Create new tab control
  2. Create a tab item
  3. Add tab item 1 to the tab control
  4. Add tab item 1 content to tab item 1
  5. Add tab item 2 to the tab control
  6. Add tab item 2 content to tab item 2

What you see now is a messed up layout in tab1 (currently active) When you switch to tab2, and back to tab1, the layout is correct.

When using the MML approach, the content is build fully first, then added to the tab control, which causes a layouting at that point.

Workaround: First build up all content stuff, and afterwards assign the tabItem to the tabControl.