-
Notifications
You must be signed in to change notification settings - Fork 710
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allow ItemsRepeater's layout to take non virtualizing layouts (#222)
* fix debug_test configuration * fix back version * updates. still need to add the adapter. * add the adapter to go from virtualizing context to non-virtualizing context. * adding a test * cr fixes * undo changes to solution file
- Loading branch information
Showing
18 changed files
with
338 additions
and
41 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Copyright (c) Microsoft Corporation. All rights reserved. | ||
// Licensed under the MIT License. See LICENSE in the project root for license information. | ||
|
||
using System; | ||
using Windows.Foundation; | ||
using Windows.UI.Xaml; | ||
using Windows.UI.Xaml.Controls; | ||
|
||
#if !BUILD_WINDOWS | ||
using NonVirtualizingLayoutContext = Microsoft.UI.Xaml.Controls.NonVirtualizingLayoutContext; | ||
using NonVirtualizingLayout = Microsoft.UI.Xaml.Controls.NonVirtualizingLayout; | ||
#endif | ||
|
||
namespace Windows.UI.Xaml.Tests.MUXControls.ApiTests.RepeaterTests.Common | ||
{ | ||
public class NonVirtualStackLayout : NonVirtualizingLayout | ||
{ | ||
protected override Size MeasureOverride(NonVirtualizingLayoutContext context, Size availableSize) | ||
{ | ||
double extentHeight = 0.0; | ||
double extentWidth = 0.0; | ||
foreach (var element in context.Children) | ||
{ | ||
element.Measure(availableSize); | ||
extentHeight += element.DesiredSize.Height; | ||
extentWidth = Math.Max(extentWidth, element.DesiredSize.Width); | ||
} | ||
|
||
return new Size(extentWidth, extentHeight); | ||
} | ||
|
||
protected override Size ArrangeOverride(NonVirtualizingLayoutContext context, Size finalSize) | ||
{ | ||
double offset = 0.0; | ||
foreach (var element in context.Children) | ||
{ | ||
element.Arrange(new Rect(0, offset, element.DesiredSize.Width, element.DesiredSize.Height)); | ||
offset += element.DesiredSize.Height; | ||
} | ||
|
||
return finalSize; | ||
} | ||
} | ||
} |
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
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
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
Oops, something went wrong.