54 lines
1.3 KiB
Markdown
54 lines
1.3 KiB
Markdown
## Resizing a Grid can hang
|
|
|
|
### Scope
|
|
Edge
|
|
|
|
### Version Introduced
|
|
4.7
|
|
|
|
### Version Reverted
|
|
4.7.1
|
|
|
|
### Source Analyzer Status
|
|
NotPlanned
|
|
|
|
### Change Description
|
|
An infinite loop can occur during layout of a `T:System.Windows.Controls.Grid` under the following
|
|
circumstances:
|
|
|
|
* Row definitions contain two *-rows, both declaring a MinHeight and a MaxHeight.
|
|
* Content of the *-rows doesn't exceed the corresponding MaxHeight
|
|
* The Grid's available height is exceeded by the first MinHeight (plus any other fixed or Auto rows)
|
|
* The app targets .NET Framework 4.7, or opts in to the 4.7 allocation algorithm by setting
|
|
`Switch.System.Windows.Controls.Grid.StarDefinitionsCanExceedAvailableSpace=false`
|
|
|
|
The loop would also happen with more than two rows, or in the analogous case for columns.
|
|
|
|
The issue is fixed in .NET Framework 4.7.1.
|
|
|
|
- [ ] Quirked
|
|
- [ ] Build-time break
|
|
|
|
### Recommended Action
|
|
Upgrade to .NET Framework 4.7.1. Alternatively, if you don't need the 4.7 allocation algorithm
|
|
you can use the following configuration setting:
|
|
|
|
```xml
|
|
<runtime>
|
|
<AppContextSwitchOverrides value="Switch.System.Windows.Controls.Grid.StarDefinitionsCanExceedAvailableSpace=true" />
|
|
</runtime>
|
|
```
|
|
|
|
### Affected APIs
|
|
* Not detectable via API analysis
|
|
|
|
### Category
|
|
Windows Presentation Foundation (WPF)
|
|
|
|
<!--
|
|
### Original Bug
|
|
442027
|
|
-->
|
|
|
|
|