No edit summary |
No edit summary |
||
Line 1: | Line 1: | ||
The PlacingContainer is a way organize a view based on box-in-box principle, in contrast | The PlacingContainer is a way to organize a view based on the box-in-box principle, in contrast to the default way of placing components on a ViewModel in a Grid pattern with x and y coordinates. | ||
The web browser [https://www.w3schools.com/css/css3_flexbox.asp FlexBox] has been used for most of how the Placing containers work. | The web browser [https://www.w3schools.com/css/css3_flexbox.asp FlexBox] has been used for most of how the Placing containers work. | ||
When using the web renderer (for example in TurnKey) the output from the framework will be HTML with '''flexbox CSS''' for layout. In the designer and | When using the web renderer (for example, in TurnKey), the output from the framework will be HTML with '''flexbox CSS''' for layout. In the designer and a WPF application, you're using MDriven's implementation of a flexbox renderer. | ||
PlacingContainers are introduced in this blog article: https://blog.mdriven.net/placingcontainers-flexbox/ | PlacingContainers are introduced in this blog article: https://blog.mdriven.net/placingcontainers-flexbox/ | ||
=== Notes for when you're confused by why you're seeing when working with placing containers ( | === Notes for when you're confused by why you're seeing when working with placing containers (flexbox) === | ||
==== Why isn't this container filling (becoming the | ==== Why isn't this container filling (becoming the same width of) the container above? ==== | ||
If you haven't made any special | If you haven't made any special settings, it's probably because a container only "fills" the container above in a perpendicular direction. If you want it to fill the whole width, for example, for a table, make its direction "Column". | ||
* Direction Column => Fills | * Direction Column => Fills horizontally and stacks vertically | ||
* Direction Row => Fills | * Direction Row => Fills vertically and stacks horizontally | ||
==== I want to make a table | ==== I want to make a table with one fixed-width column and the rest with a flexible width ==== | ||
In the table the goal is to have the images in fixed size, and the right | In the table, the goal is to have the images in a fixed size, and the right takes up the rest of the page width. It is important to know that there's no way in containers/flexbox to make rows aware of each other, so the image size needs to be fixed or at least, fixed for a screen size range. Use CSS media queries to make them different depending on the screen size. | ||
[[File:Fixed left column.png|none|frame]] | [[File:Fixed left column.png|none|frame]] | ||
ViewModel; | |||
[[File:Table viewmodel.png|none|frame]] | [[File:Table viewmodel.png|none|frame]] | ||
The main thing to understand here is that you need to set | The main thing to understand here is that you need to set: | ||
* Imagecolumn to Grow = 0 | * Imagecolumn to Grow = 0 | ||
* Fieldcolumn to Grow = 1 | * Fieldcolumn to Grow = 1 |
Revision as of 06:52, 3 February 2023
The PlacingContainer is a way to organize a view based on the box-in-box principle, in contrast to the default way of placing components on a ViewModel in a Grid pattern with x and y coordinates.
The web browser FlexBox has been used for most of how the Placing containers work.
When using the web renderer (for example, in TurnKey), the output from the framework will be HTML with flexbox CSS for layout. In the designer and a WPF application, you're using MDriven's implementation of a flexbox renderer.
PlacingContainers are introduced in this blog article: https://blog.mdriven.net/placingcontainers-flexbox/
Notes for when you're confused by why you're seeing when working with placing containers (flexbox)
Why isn't this container filling (becoming the same width of) the container above?
If you haven't made any special settings, it's probably because a container only "fills" the container above in a perpendicular direction. If you want it to fill the whole width, for example, for a table, make its direction "Column".
- Direction Column => Fills horizontally and stacks vertically
- Direction Row => Fills vertically and stacks horizontally
I want to make a table with one fixed-width column and the rest with a flexible width
In the table, the goal is to have the images in a fixed size, and the right takes up the rest of the page width. It is important to know that there's no way in containers/flexbox to make rows aware of each other, so the image size needs to be fixed or at least, fixed for a screen size range. Use CSS media queries to make them different depending on the screen size.
ViewModel;
The main thing to understand here is that you need to set:
- Imagecolumn to Grow = 0
- Fieldcolumn to Grow = 1
This makes the field column fill the remaining space horizontally.
You can control how large the columns will be on the column itself using Self-align (X-direction).