From 9efa63a71fa7a007f103819533c0ce646f87cb90 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Wed, 27 Feb 2019 01:27:22 -0500 Subject: [PATCH 1/3] typo: colum -> column --- .../retargeting/wpf/wpf-grid-allocation-space-star-columns.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md b/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md index 55e55431eedb3..2ed7ce25dba30 100644 --- a/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md +++ b/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md @@ -2,7 +2,7 @@ | | | |---|---| -|Details|Starting with the .NET Framework 4.7, WPF replaces the algorithm that uses to allocate space to \*-columns. This will change the actual width assigned to \*-columns in a number of cases:In the first two cases, the widths produced by the new algorithm can be significantly different from those produced by the old algorithm; in the last case, the difference will be at most one or two pixels.

The new algorithm fixes several bugs present in the old algorithm:

  1. Total allocation to columns can exceed the Grid's width. This can occur when allocating space to a column whose proportional share is less than its minimum size. The algorithm allocates the minimum size, which decreases the space available to other columns. If there are no \*-columns left to allocate, the total allocation will be too large.
  2. Total allocation can fall short of the Grid's width. This is the dual problem to #1, arising when allocating to a column whose proportional share is greater than its maximum size, with no \*-columns left to take up the slack.
  3. Two \*-columns can receive allocations not proportional to their \*-weights. This is a milder version of #1/#2, arising when allocating to \*-columns A, B, and C (in that order), where B's proportional share violates its min (or max) constraint. As above, this changes the space available to column C, who gets less (or more) proportional allocation than A did,
  4. Columns with extremely large weights (> 10^298) are all treated as if they had weight 10^298. Proportional differences between them (and between columns with slightly smaller weights) are not honored.
  5. Columns with inifinte weights are not handled correctly. [Actually you can't set a weight to Infinity, but this is an artificial restriction. The allocation code was trying to handle it, but doing a bad job.]
  6. Several minor problems while avoiding overflow, underflow, loss of precision and similar floating-point issues.
  7. Adjustments for layout rounding are incorrect at sufficiently high DPI.
The new algorithm produces results that meet the following criteria:

A. The actual width assigned to a \*-column is never less than its minimum width nor greater than its maximum width.
B. Each -column that is not assigned its minimum or maximum width is assigned a width proportional to its -weight. To be precise, if two columns are declared with width x and y respectively, and if neither column receives its minimum or maximum width, the actual widths v and w assigned to the columns are in the same proportion: v / w == x / y.
C. The total width allocated to "proportional" \*-columns is equal to the space available after allocating to the constrained columns (fixed, auto, and \*-columns that are allocated their min or max width). This might be zero, for instance if the sum of the minimum widths exceeds the Grid's availbable width.
D. All these statements are to be interpreted with respect to the "ideal" layout. When layout rounding is in effect, the actual widths can differ from the ideal widths by as much as one pixel.
The old algorithm honored (A) but failed to honor the other criteria in the cases outlined above.

Everything said about columns and widths in this article applies as well to rows and heights.| +|Details|Starting with the .NET Framework 4.7, WPF replaces the algorithm that uses to allocate space to \*-columns. This will change the actual width assigned to \*-columns in a number of cases:

In the first two cases, the widths produced by the new algorithm can be significantly different from those produced by the old algorithm; in the last case, the difference will be at most one or two pixels.

The new algorithm fixes several bugs present in the old algorithm:

  1. Total allocation to columns can exceed the Grid's width. This can occur when allocating space to a column whose proportional share is less than its minimum size. The algorithm allocates the minimum size, which decreases the space available to other columns. If there are no \*-columns left to allocate, the total allocation will be too large.
  2. Total allocation can fall short of the Grid's width. This is the dual problem to #1, arising when allocating to a column whose proportional share is greater than its maximum size, with no \*-columns left to take up the slack.
  3. Two \*-columns can receive allocations not proportional to their \*-weights. This is a milder version of #1/#2, arising when allocating to \*-columns A, B, and C (in that order), where B's proportional share violates its min (or max) constraint. As above, this changes the space available to column C, who gets less (or more) proportional allocation than A did,
  4. Columns with extremely large weights (> 10^298) are all treated as if they had weight 10^298. Proportional differences between them (and between columns with slightly smaller weights) are not honored.
  5. Columns with inifinte weights are not handled correctly. [Actually you can't set a weight to Infinity, but this is an artificial restriction. The allocation code was trying to handle it, but doing a bad job.]
  6. Several minor problems while avoiding overflow, underflow, loss of precision and similar floating-point issues.
  7. Adjustments for layout rounding are incorrect at sufficiently high DPI.
The new algorithm produces results that meet the following criteria:

A. The actual width assigned to a \*-column is never less than its minimum width nor greater than its maximum width.
B. Each -column that is not assigned its minimum or maximum width is assigned a width proportional to its -weight. To be precise, if two columns are declared with width x and y respectively, and if neither column receives its minimum or maximum width, the actual widths v and w assigned to the columns are in the same proportion: v / w == x / y.
C. The total width allocated to "proportional" \*-columns is equal to the space available after allocating to the constrained columns (fixed, auto, and \*-columns that are allocated their min or max width). This might be zero, for instance if the sum of the minimum widths exceeds the Grid's availbable width.
D. All these statements are to be interpreted with respect to the "ideal" layout. When layout rounding is in effect, the actual widths can differ from the ideal widths by as much as one pixel.
The old algorithm honored (A) but failed to honor the other criteria in the cases outlined above.

Everything said about columns and widths in this article applies as well to rows and heights.| |Suggestion|By default, apps that target versions of the .NET Framework starting with the .NET Framework 4.7 will see the new algorithm, while apps that target the .NET Framework 4.6.2 or earlier versions will see the old algorithm.

To override the default, use the following configuration setting:

<runtime>
<AppContextSwitchOverrides value="Switch.System.Windows.Controls.Grid.StarDefinitionsCanExceedAvailableSpace=true" />
</runtime>
The value true selects the old algorithm, false selects the new algorithm.| |Scope|Minor| |Version|4.7| From d6b2bae0a609eea82606d9e49b6c1946e46766b1 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Wed, 27 Feb 2019 01:30:51 -0500 Subject: [PATCH 2/3] typo: inifinte -> infinite --- .../retargeting/wpf/wpf-grid-allocation-space-star-columns.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md b/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md index 2ed7ce25dba30..a607db709fc85 100644 --- a/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md +++ b/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md @@ -2,7 +2,7 @@ | | | |---|---| -|Details|Starting with the .NET Framework 4.7, WPF replaces the algorithm that uses to allocate space to \*-columns. This will change the actual width assigned to \*-columns in a number of cases:
  • When one or more \*-columns also have a minimum or maximum width that overrides the proportional allocation for that column. (The minimum width can derive from an explicit MinWidth declaration, or from an implicit minimum obtained from the column's content. The maximum width can only be defined explicitly, from a MaxWidth declaration.)
  • When one or more \*-columns declare an extremely large \*-weight, greater than 10^298.
  • When the \*-weights are sufficiently different to encounter floating-point instability (overflow, underflow, loss of precision).
  • When layout rounding is enabled, and the effective display DPI is sufficiently high.
In the first two cases, the widths produced by the new algorithm can be significantly different from those produced by the old algorithm; in the last case, the difference will be at most one or two pixels.

The new algorithm fixes several bugs present in the old algorithm:

  1. Total allocation to columns can exceed the Grid's width. This can occur when allocating space to a column whose proportional share is less than its minimum size. The algorithm allocates the minimum size, which decreases the space available to other columns. If there are no \*-columns left to allocate, the total allocation will be too large.
  2. Total allocation can fall short of the Grid's width. This is the dual problem to #1, arising when allocating to a column whose proportional share is greater than its maximum size, with no \*-columns left to take up the slack.
  3. Two \*-columns can receive allocations not proportional to their \*-weights. This is a milder version of #1/#2, arising when allocating to \*-columns A, B, and C (in that order), where B's proportional share violates its min (or max) constraint. As above, this changes the space available to column C, who gets less (or more) proportional allocation than A did,
  4. Columns with extremely large weights (> 10^298) are all treated as if they had weight 10^298. Proportional differences between them (and between columns with slightly smaller weights) are not honored.
  5. Columns with inifinte weights are not handled correctly. [Actually you can't set a weight to Infinity, but this is an artificial restriction. The allocation code was trying to handle it, but doing a bad job.]
  6. Several minor problems while avoiding overflow, underflow, loss of precision and similar floating-point issues.
  7. Adjustments for layout rounding are incorrect at sufficiently high DPI.
The new algorithm produces results that meet the following criteria:

A. The actual width assigned to a \*-column is never less than its minimum width nor greater than its maximum width.
B. Each -column that is not assigned its minimum or maximum width is assigned a width proportional to its -weight. To be precise, if two columns are declared with width x and y respectively, and if neither column receives its minimum or maximum width, the actual widths v and w assigned to the columns are in the same proportion: v / w == x / y.
C. The total width allocated to "proportional" \*-columns is equal to the space available after allocating to the constrained columns (fixed, auto, and \*-columns that are allocated their min or max width). This might be zero, for instance if the sum of the minimum widths exceeds the Grid's availbable width.
D. All these statements are to be interpreted with respect to the "ideal" layout. When layout rounding is in effect, the actual widths can differ from the ideal widths by as much as one pixel.
The old algorithm honored (A) but failed to honor the other criteria in the cases outlined above.

Everything said about columns and widths in this article applies as well to rows and heights.| +|Details|Starting with the .NET Framework 4.7, WPF replaces the algorithm that uses to allocate space to \*-columns. This will change the actual width assigned to \*-columns in a number of cases:

  • When one or more \*-columns also have a minimum or maximum width that overrides the proportional allocation for that column. (The minimum width can derive from an explicit MinWidth declaration, or from an implicit minimum obtained from the column's content. The maximum width can only be defined explicitly, from a MaxWidth declaration.)
  • When one or more \*-columns declare an extremely large \*-weight, greater than 10^298.
  • When the \*-weights are sufficiently different to encounter floating-point instability (overflow, underflow, loss of precision).
  • When layout rounding is enabled, and the effective display DPI is sufficiently high.
In the first two cases, the widths produced by the new algorithm can be significantly different from those produced by the old algorithm; in the last case, the difference will be at most one or two pixels.

The new algorithm fixes several bugs present in the old algorithm:

  1. Total allocation to columns can exceed the Grid's width. This can occur when allocating space to a column whose proportional share is less than its minimum size. The algorithm allocates the minimum size, which decreases the space available to other columns. If there are no \*-columns left to allocate, the total allocation will be too large.
  2. Total allocation can fall short of the Grid's width. This is the dual problem to #1, arising when allocating to a column whose proportional share is greater than its maximum size, with no \*-columns left to take up the slack.
  3. Two \*-columns can receive allocations not proportional to their \*-weights. This is a milder version of #1/#2, arising when allocating to \*-columns A, B, and C (in that order), where B's proportional share violates its min (or max) constraint. As above, this changes the space available to column C, who gets less (or more) proportional allocation than A did,
  4. Columns with extremely large weights (> 10^298) are all treated as if they had weight 10^298. Proportional differences between them (and between columns with slightly smaller weights) are not honored.
  5. Columns with infinite weights are not handled correctly. [Actually you can't set a weight to Infinity, but this is an artificial restriction. The allocation code was trying to handle it, but doing a bad job.]
  6. Several minor problems while avoiding overflow, underflow, loss of precision and similar floating-point issues.
  7. Adjustments for layout rounding are incorrect at sufficiently high DPI.
The new algorithm produces results that meet the following criteria:

A. The actual width assigned to a \*-column is never less than its minimum width nor greater than its maximum width.
B. Each -column that is not assigned its minimum or maximum width is assigned a width proportional to its -weight. To be precise, if two columns are declared with width x and y respectively, and if neither column receives its minimum or maximum width, the actual widths v and w assigned to the columns are in the same proportion: v / w == x / y.
C. The total width allocated to "proportional" \*-columns is equal to the space available after allocating to the constrained columns (fixed, auto, and \*-columns that are allocated their min or max width). This might be zero, for instance if the sum of the minimum widths exceeds the Grid's availbable width.
D. All these statements are to be interpreted with respect to the "ideal" layout. When layout rounding is in effect, the actual widths can differ from the ideal widths by as much as one pixel.
The old algorithm honored (A) but failed to honor the other criteria in the cases outlined above.

Everything said about columns and widths in this article applies as well to rows and heights.| |Suggestion|By default, apps that target versions of the .NET Framework starting with the .NET Framework 4.7 will see the new algorithm, while apps that target the .NET Framework 4.6.2 or earlier versions will see the old algorithm.

To override the default, use the following configuration setting:

<runtime>
<AppContextSwitchOverrides value="Switch.System.Windows.Controls.Grid.StarDefinitionsCanExceedAvailableSpace=true" />
</runtime>
The value true selects the old algorithm, false selects the new algorithm.| |Scope|Minor| |Version|4.7| From 8d0ad78c31b16688bcfaabd6804bce174ffd686a Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Wed, 27 Feb 2019 01:31:23 -0500 Subject: [PATCH 3/3] typo: availbable -> available --- .../retargeting/wpf/wpf-grid-allocation-space-star-columns.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md b/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md index a607db709fc85..fde36326e8663 100644 --- a/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md +++ b/includes/migration-guide/retargeting/wpf/wpf-grid-allocation-space-star-columns.md @@ -2,7 +2,7 @@ | | | |---|---| -|Details|Starting with the .NET Framework 4.7, WPF replaces the algorithm that uses to allocate space to \*-columns. This will change the actual width assigned to \*-columns in a number of cases:
  • When one or more \*-columns also have a minimum or maximum width that overrides the proportional allocation for that column. (The minimum width can derive from an explicit MinWidth declaration, or from an implicit minimum obtained from the column's content. The maximum width can only be defined explicitly, from a MaxWidth declaration.)
  • When one or more \*-columns declare an extremely large \*-weight, greater than 10^298.
  • When the \*-weights are sufficiently different to encounter floating-point instability (overflow, underflow, loss of precision).
  • When layout rounding is enabled, and the effective display DPI is sufficiently high.
In the first two cases, the widths produced by the new algorithm can be significantly different from those produced by the old algorithm; in the last case, the difference will be at most one or two pixels.

The new algorithm fixes several bugs present in the old algorithm:

  1. Total allocation to columns can exceed the Grid's width. This can occur when allocating space to a column whose proportional share is less than its minimum size. The algorithm allocates the minimum size, which decreases the space available to other columns. If there are no \*-columns left to allocate, the total allocation will be too large.
  2. Total allocation can fall short of the Grid's width. This is the dual problem to #1, arising when allocating to a column whose proportional share is greater than its maximum size, with no \*-columns left to take up the slack.
  3. Two \*-columns can receive allocations not proportional to their \*-weights. This is a milder version of #1/#2, arising when allocating to \*-columns A, B, and C (in that order), where B's proportional share violates its min (or max) constraint. As above, this changes the space available to column C, who gets less (or more) proportional allocation than A did,
  4. Columns with extremely large weights (> 10^298) are all treated as if they had weight 10^298. Proportional differences between them (and between columns with slightly smaller weights) are not honored.
  5. Columns with infinite weights are not handled correctly. [Actually you can't set a weight to Infinity, but this is an artificial restriction. The allocation code was trying to handle it, but doing a bad job.]
  6. Several minor problems while avoiding overflow, underflow, loss of precision and similar floating-point issues.
  7. Adjustments for layout rounding are incorrect at sufficiently high DPI.
The new algorithm produces results that meet the following criteria:

A. The actual width assigned to a \*-column is never less than its minimum width nor greater than its maximum width.
B. Each -column that is not assigned its minimum or maximum width is assigned a width proportional to its -weight. To be precise, if two columns are declared with width x and y respectively, and if neither column receives its minimum or maximum width, the actual widths v and w assigned to the columns are in the same proportion: v / w == x / y.
C. The total width allocated to "proportional" \*-columns is equal to the space available after allocating to the constrained columns (fixed, auto, and \*-columns that are allocated their min or max width). This might be zero, for instance if the sum of the minimum widths exceeds the Grid's availbable width.
D. All these statements are to be interpreted with respect to the "ideal" layout. When layout rounding is in effect, the actual widths can differ from the ideal widths by as much as one pixel.
The old algorithm honored (A) but failed to honor the other criteria in the cases outlined above.

Everything said about columns and widths in this article applies as well to rows and heights.| +|Details|Starting with the .NET Framework 4.7, WPF replaces the algorithm that uses to allocate space to \*-columns. This will change the actual width assigned to \*-columns in a number of cases:

  • When one or more \*-columns also have a minimum or maximum width that overrides the proportional allocation for that column. (The minimum width can derive from an explicit MinWidth declaration, or from an implicit minimum obtained from the column's content. The maximum width can only be defined explicitly, from a MaxWidth declaration.)
  • When one or more \*-columns declare an extremely large \*-weight, greater than 10^298.
  • When the \*-weights are sufficiently different to encounter floating-point instability (overflow, underflow, loss of precision).
  • When layout rounding is enabled, and the effective display DPI is sufficiently high.
In the first two cases, the widths produced by the new algorithm can be significantly different from those produced by the old algorithm; in the last case, the difference will be at most one or two pixels.

The new algorithm fixes several bugs present in the old algorithm:

  1. Total allocation to columns can exceed the Grid's width. This can occur when allocating space to a column whose proportional share is less than its minimum size. The algorithm allocates the minimum size, which decreases the space available to other columns. If there are no \*-columns left to allocate, the total allocation will be too large.
  2. Total allocation can fall short of the Grid's width. This is the dual problem to #1, arising when allocating to a column whose proportional share is greater than its maximum size, with no \*-columns left to take up the slack.
  3. Two \*-columns can receive allocations not proportional to their \*-weights. This is a milder version of #1/#2, arising when allocating to \*-columns A, B, and C (in that order), where B's proportional share violates its min (or max) constraint. As above, this changes the space available to column C, who gets less (or more) proportional allocation than A did,
  4. Columns with extremely large weights (> 10^298) are all treated as if they had weight 10^298. Proportional differences between them (and between columns with slightly smaller weights) are not honored.
  5. Columns with infinite weights are not handled correctly. [Actually you can't set a weight to Infinity, but this is an artificial restriction. The allocation code was trying to handle it, but doing a bad job.]
  6. Several minor problems while avoiding overflow, underflow, loss of precision and similar floating-point issues.
  7. Adjustments for layout rounding are incorrect at sufficiently high DPI.
The new algorithm produces results that meet the following criteria:

A. The actual width assigned to a \*-column is never less than its minimum width nor greater than its maximum width.
B. Each -column that is not assigned its minimum or maximum width is assigned a width proportional to its -weight. To be precise, if two columns are declared with width x and y respectively, and if neither column receives its minimum or maximum width, the actual widths v and w assigned to the columns are in the same proportion: v / w == x / y.
C. The total width allocated to "proportional" \*-columns is equal to the space available after allocating to the constrained columns (fixed, auto, and \*-columns that are allocated their min or max width). This might be zero, for instance if the sum of the minimum widths exceeds the Grid's available width.
D. All these statements are to be interpreted with respect to the "ideal" layout. When layout rounding is in effect, the actual widths can differ from the ideal widths by as much as one pixel.
The old algorithm honored (A) but failed to honor the other criteria in the cases outlined above.

Everything said about columns and widths in this article applies as well to rows and heights.| |Suggestion|By default, apps that target versions of the .NET Framework starting with the .NET Framework 4.7 will see the new algorithm, while apps that target the .NET Framework 4.6.2 or earlier versions will see the old algorithm.

To override the default, use the following configuration setting:

<runtime>
<AppContextSwitchOverrides value="Switch.System.Windows.Controls.Grid.StarDefinitionsCanExceedAvailableSpace=true" />
</runtime>
The value true selects the old algorithm, false selects the new algorithm.| |Scope|Minor| |Version|4.7|