Skip to content

Commit

Permalink
fix!: Make GridExtensions internal (#12174)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `GridExtensions` is made internal

GitHub Issue (If applicable): Part of #8339. **NOTE:**
#8339 states that this type
should be moved to legacy namespace. I took a stronger step here and
made this type internal as I don't think it's something that should be
public.

<!-- Link to relevant GitHub issue if applicable. All PRs should be
associated with an issue (GitHub issue or internal), unless the change
is documentation related. -->

## PR Type

What kind of change does this PR introduce?
<!-- Please uncomment one or more that apply to this PR

- Bugfix
- Feature
- Code style update (formatting)
- Refactoring (no functional changes, no api changes)
- Build or CI related changes
- Documentation content changes
- Project automation
- Other... Please describe:

-->

## What is the current behavior?

<!-- Please describe the current behavior that you are modifying, or
link to a relevant issue. -->


## What is the new behavior?

<!-- Please describe the new behavior after your modifications. -->


## PR Checklist

Please check if your PR fulfills the following requirements:

- [ ] Docs have been added/updated which fit [documentation
template](https://github.com/unoplatform/uno/blob/master/doc/.feature-template.md)
(for bug fixes / features)
- [ ] [Unit Tests and/or UI
Tests](https://github.com/unoplatform/uno/blob/master/doc/articles/uno-development/working-with-the-samples-apps.md)
for the changes have been added (for bug fixes / features) (if
applicable)
- [ ] Validated PR `Screenshots Compare Test Run` results.
- [ ] Contains **NO** breaking changes
- [ ] Associated with an issue (GitHub or internal) and uses the
[automatic close
keywords](https://help.github.com/en/github/managing-your-work-on-github/linking-a-pull-request-to-an-issue).
- [ ] Commits must be following the [Conventional
Commits](https://www.conventionalcommits.org/en/v1.0.0/#summary)
specification.

<!-- If this PR contains a breaking change, please describe the impact
and migration path for existing applications below.
     Please note that breaking changes are likely to be rejected -->

## Other information

<!-- Please provide any additional information if necessary -->

Internal Issue (If applicable):
<!-- Link to relevant internal issue if applicable. All PRs should be
associated with an issue (GitHub issue or internal) -->
  • Loading branch information
Youssef1313 authored May 8, 2023
2 parents b51b6bd + 775576e commit ade59d3
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 ade59d3

Please sign in to comment.