Skip to content

Commit bd90769

Browse files
Merge pull request #1846 from skendrot/GridSplitterMinWidth
Fix GridSplitter violating min width of columns
2 parents c32681c + 4f44fa8 commit bd90769

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

Microsoft.Toolkit.Uwp.UI.Controls/GridSplitter/GridSplitter.Events.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,11 @@ private bool VerticalMove(double verticalChange)
194194
// if sibling row has fixed width then resize it
195195
else if (!IsStarRow(SiblingRow))
196196
{
197+
// Would adding to this column make the current column violate the MinWidth?
198+
if (IsValidRowHeight(CurrentRow, verticalChange) == false)
199+
{
200+
return false;
201+
}
197202
if (!SetRowHeight(SiblingRow, verticalChange * -1, GridUnitType.Pixel))
198203
{
199204
return true;
@@ -254,6 +259,12 @@ private bool HorizontalMove(double horizontalChange)
254259
// if sibling column has fixed width then resize it
255260
else if (!IsStarColumn(SiblingColumn))
256261
{
262+
// Would adding to this column make the current column violate the MinWidth?
263+
if (IsValidColumnWidth(CurrentColumn, horizontalChange) == false)
264+
{
265+
return false;
266+
}
267+
257268
if (!SetColumnWidth(SiblingColumn, horizontalChange * -1, GridUnitType.Pixel))
258269
{
259270
return true;

0 commit comments

Comments
 (0)