Skip to content

Commit

Permalink
fix!: Make GridExtensions internal
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `GridExtensions` is made internal
  • Loading branch information
Youssef1313 committed May 7, 2023
1 parent 3c9eb5f commit 775576e
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 28 deletions.
1 change: 1 addition & 0 deletions build/PackageDiffIgnore.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9155,6 +9155,7 @@
<Member fullName="Uno.Presentation.Resources.IResourceRegistry" reason="Api alignments" />
<Member fullName="Uno.Presentation.Resources.ResourceRegistry" reason="Api alignments" />
<Member fullName="Microsoft.UI.Xaml.Controls.ControlsResourcesVersion" reason="Api alignments" />
<Member fullName="Windows.UI.Xaml.Controls.GridExtensions" reason="Api alignments" />

<Member fullName="Uno.UI.Toolkit.Uno_UI_Toolkit_XamlTypeInfo.XamlMetaDataProvider" reason="Renamed project, reflection-based API for UAP/WinAPPSDK only" />

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
using Uno.UI;
using Windows.Graphics.Display;

#if !WINDOWS_UWP
using Uno.UI.Controls.Legacy;
#endif

#if __IOS__
using UIKit;
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using System.Linq;
using Windows.Foundation;
using FluentAssertions;
using Uno.UI.Controls.Legacy;

namespace Uno.UI.Tests.GridTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using FluentAssertions;
using FluentAssertions.Execution;
using Windows.UI.Xaml;
using Uno.UI.Controls.Legacy;

namespace Uno.UI.Tests.GridTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using Windows.Foundation;
using FluentAssertions;
using FluentAssertions.Execution;
using Uno.UI.Controls.Legacy;

namespace Uno.UI.Tests.GridTests
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using Windows.Foundation;
using FluentAssertions;
using FluentAssertions.Execution;
using Uno.UI.Controls.Legacy;
using Uno.UI.Tests.Windows_UI_XAML_Controls.GridTests.Controls;

namespace Uno.UI.Tests.GridTests
Expand Down
38 changes: 10 additions & 28 deletions src/Uno.UI/UI/Xaml/Controls/Grid/GridExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,31 +1,13 @@
using View = Windows.UI.Xaml.UIElement;
using Windows.UI.Xaml.Controls;

namespace Windows.UI.Xaml.Controls
using View = Windows.UI.Xaml.UIElement;

namespace Uno.UI.Controls.Legacy
{
public static class GridExtensions
internal static class GridExtensions
{
public static Grid ColumnDefinitions(this Grid grid, params string[] definitions)
{
foreach (var def in definitions)
{
grid.ColumnDefinitions.Add(new ColumnDefinition { Width = (GridLength)def });
}

return grid;
}

public static Grid RowDefinitions(this Grid grid, params string[] definitions)
{
foreach (var def in definitions)
{
grid.RowDefinitions.Add(new RowDefinition { Height = (GridLength)def });
}

return grid;
}

/// <summary>
/// Sets the row for the specified control, when included in a Grid control.
/// Sets the row for the specified control, when included in a Grid control.
/// </summary>
/// <param name="row">The row to be set for the control</param>
/// <returns>The view to be used in a fluent expression.</returns>
Expand All @@ -38,7 +20,7 @@ public static T GridRow<T>(this T view, int row)
}

/// <summary>
/// Sets the row for the specified control, when included in a Grid control.
/// Sets the row for the specified control, when included in a Grid control.
/// </summary>
/// <param name="rowSpan">The row to be set for the control</param>
/// <returns>The view to be used in a fluent expression.</returns>
Expand All @@ -51,7 +33,7 @@ public static T GridRowSpan<T>(this T view, int rowSpan)
}

/// <summary>
/// Sets the column for the specified control, when included in a Grid control.
/// Sets the column for the specified control, when included in a Grid control.
/// </summary>
/// <param name="column">The column to be set for the control</param>
/// <returns>The view to be used in a fluent expression.</returns>
Expand All @@ -65,7 +47,7 @@ public static T GridColumn<T>(this T view, int column)


/// <summary>
/// Sets the column span for the specified control, when included in a Grid control.
/// Sets the column span for the specified control, when included in a Grid control.
/// </summary>
/// <param name="columnSpan">The column to be set for the control</param>
/// <returns>The view to be used in a fluent expression.</returns>
Expand All @@ -78,7 +60,7 @@ public static T GridColumnSpan<T>(this T view, int columnSpan)
}

/// <summary>
/// Sets the column and row for the specified control, when included in a Grid control.
/// Sets the column and row for the specified control, when included in a Grid control.
/// </summary>
/// <param name="column">The column to be set for the control</param>
/// <returns>The view to be used in a fluent expression.</returns>
Expand Down

0 comments on commit 775576e

Please sign in to comment.