Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In UWP (non-WinUI) GridLengthHelper.Auto fails with MethodAccessException, this is a UWP-only workaround.
- Loading branch information
1 parent
72c6603
commit d330404
Showing
3 changed files
with
61 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
...SamplesApp/SamplesApp.UnitTests.Shared/Controls/UITests/Views/Helper/GridLengthHelper2.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.Text; | ||
using Windows.UI.Xaml; | ||
|
||
namespace Uno.UI.Samples.Helper | ||
{ | ||
class GridLengthHelper2 | ||
{ | ||
public static GridLength Auto => | ||
#if NETFX_CORE && !HAS_UNO_WINUI | ||
GridLength.Auto; | ||
#else | ||
GridLengthHelper.Auto; | ||
#endif | ||
|
||
internal static GridLength FromValueAndType(double value, GridUnitType pixel) => | ||
#if NETFX_CORE && !HAS_UNO_WINUI | ||
new GridLength(value, pixel); | ||
#else | ||
GridLengthHelper.FromValueAndType(value, pixel); | ||
#endif | ||
|
||
internal static bool GetIsStar(GridLength sizeHint) => | ||
#if NETFX_CORE && !HAS_UNO_WINUI | ||
sizeHint.IsStar; | ||
#else | ||
GridLengthHelper.GetIsStar(sizeHint); | ||
#endif | ||
|
||
internal static bool GetIsAbsolute(GridLength sizeHint) => | ||
#if NETFX_CORE && !HAS_UNO_WINUI | ||
sizeHint.IsAbsolute; | ||
#else | ||
GridLengthHelper.GetIsAbsolute(sizeHint); | ||
#endif | ||
|
||
internal static bool GetIsAuto(GridLength sizeHint) => | ||
#if NETFX_CORE && !HAS_UNO_WINUI | ||
sizeHint.IsAuto; | ||
#else | ||
GridLengthHelper.GetIsAuto(sizeHint); | ||
#endif | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters