|
1 | 1 | --- |
2 | 2 | title: StretchPanel |
3 | | -author: githubaccount |
4 | | -description: TODO: Your experiment's description here |
| 3 | +author: Avid29 |
| 4 | +description: A highly flexible panel that arranges its child elements according to GridLength definitions, allowing for proportional sizing and stretching behavior. |
5 | 5 | keywords: StretchPanel, Control, Layout |
6 | 6 | dev_langs: |
7 | 7 | - csharp |
8 | | -category: Controls |
9 | | -subcategory: Layout |
| 8 | +category: Layouts |
| 9 | +subcategory: Panel |
10 | 10 | discussion-id: 0 |
11 | 11 | issue-id: 0 |
12 | 12 | icon: assets/icon.png |
13 | 13 | --- |
14 | 14 |
|
15 | | -<!-- To know about all the available Markdown syntax, Check out https://docs.microsoft.com/contribute/markdown-reference --> |
16 | | -<!-- Ensure you remove all comments before submission, to ensure that there are no formatting issues when displaying this page. --> |
17 | | -<!-- It is recommended to check how the Documentation will look in the sample app, before Merging a PR --> |
18 | | -<!-- **Note:** All links to other docs.microsoft.com pages should be relative without locale, i.e. for the one above would be /contribute/markdown-reference --> |
19 | | -<!-- Included images should be optimized for size and not include any Intellectual Property references. --> |
20 | | - |
21 | | -<!-- Be sure to update the discussion/issue numbers above with your Labs discussion/issue id numbers in order for UI links to them from the sample app to work. --> |
22 | | - |
23 | 15 | # StretchPanel |
24 | 16 |
|
25 | | -TODO: Fill in information about this experiment and how to get started here... |
| 17 | +The StretchPanel is a panel that arranges its child elements according to GridLength definitions. |
26 | 18 |
|
27 | | -## Custom Control |
| 19 | +When stretched along the main axis, the child elements with star-sized GridLength values will proportionally occupy the available space. |
28 | 20 |
|
29 | | -You can inherit from an existing component as well, like `Panel`, this example shows a control without a |
30 | | -XAML Style that will be more light-weight to consume by an app developer: |
| 21 | +When not stretched along the main axis, star-sized child elements will be the smallest size possible while maintaining proportional sizing relative to each other and ensuring that all child elements are fully visible. |
31 | 22 |
|
32 | 23 | > [!Sample StretchPanelBasicSample] |
| 24 | +
|
| 25 | +## Properties |
| 26 | + |
| 27 | +### Fixed Row Length |
| 28 | + |
| 29 | +When `FixedRowLengths` is enabled, all rows/columns will to stretch to the size of the largest row/column in the panel. When this is not enabled, rows/columns will size to their content individually. |
| 30 | + |
| 31 | +### Forced Stretch Method |
| 32 | + |
| 33 | +The `ForcedStretchMethod` property allows you to specify how the StretchPanel should handle stretching in rows without star-sized definitions. |
| 34 | + |
| 35 | +#### None |
| 36 | + |
| 37 | +When set to `None`, the StretchPanel will not stretch rows/columns that do not have star-sized definitions. When the alignment is set to stretch, and even when fixed row lengths is enabled, the rows/columns without star-sized definitions will size to their content. |
| 38 | + |
| 39 | +#### First |
| 40 | + |
| 41 | +When set the `First`, the StretchPanel will stretch the first item in the row/column to occupy the remaining space when needed to comply with stretch alignment. |
| 42 | + |
| 43 | +#### Last |
| 44 | + |
| 45 | +When set to `Last`, the StretchPanel will stretch the last item in the row/column to occupy the remaining space when needed to comply with stretch alignment. |
| 46 | + |
| 47 | +#### Equal |
| 48 | + |
| 49 | +When set to `Equal`, the StretchPanel will stretch all items in the row/column to occupy the equal space throughout the row when needed to comply with stretch alignment. |
| 50 | + |
| 51 | +#### Proportional |
| 52 | + |
| 53 | +When set to `Proportional`, the StretchPanel will stretch all items in the row/column proportionally to their defined size to occupy the remaining space when needed to comply with stretch alignment. |
0 commit comments