-
Notifications
You must be signed in to change notification settings - Fork 694
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(calendar): Fix vertical stretching (most probably not on Android …
…and iOS)
- Loading branch information
Showing
5 changed files
with
76 additions
and
6 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
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
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
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
48 changes: 48 additions & 0 deletions
48
src/Uno.UI/UI/Xaml/Controls/ScrollViewer/ICustomScrollInfo.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,48 @@ | ||
using System; | ||
using System.Linq; | ||
using Windows.Foundation; | ||
|
||
namespace Windows.UI.Xaml.Controls | ||
{ | ||
internal interface ICustomScrollInfo | ||
{ | ||
/// <summary> | ||
/// Defines the desired viewport width, if not set, fallbacks to the default algorithm. | ||
/// This is used in the ScrollViewer measure and in computation of all the ScrollViewer properties. | ||
/// </summary> | ||
public double? ViewportWidth { get; } | ||
|
||
/// <summary> | ||
/// Defines the desired viewport height, if not set, fallbacks to the default algorithm | ||
/// This is used in the ScrollViewer measure and in computation of all the ScrollViewer properties. | ||
/// </summary> | ||
public double? ViewportHeight { get; } | ||
} | ||
|
||
internal static class CustomScrollInfoExtensions | ||
{ | ||
public static void ApplyViewport(this ICustomScrollInfo scrollInfo, ref Size size) | ||
{ | ||
if (scrollInfo.ViewportWidth is { } width) | ||
{ | ||
size.Width = width; | ||
} | ||
if (scrollInfo.ViewportHeight is { } height) | ||
{ | ||
size.Height = height; | ||
} | ||
} | ||
|
||
public static void ApplyViewport(this ICustomScrollInfo scrollInfo, ref Rect rect) | ||
{ | ||
if (scrollInfo.ViewportWidth is { } width) | ||
{ | ||
rect.Width = width; | ||
} | ||
if (scrollInfo.ViewportHeight is { } height) | ||
{ | ||
rect.Height = height; | ||
} | ||
} | ||
} | ||
} |