Skip to content

Commit a05b71d

Browse files
committed
Renamed to WrapPanel2
1 parent 4977f87 commit a05b71d

21 files changed

+121
-120
lines changed

components/StretchPanel/samples/StretchPanel.md

Lines changed: 0 additions & 53 deletions
This file was deleted.
File renamed without changes.

components/StretchPanel/samples/StretchPanel.Samples.csproj renamed to components/WrapPanel2/samples/WrapPanel2.Samples.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />
33

44
<PropertyGroup>
5-
<ToolkitComponentName>StretchPanel</ToolkitComponentName>
5+
<ToolkitComponentName>WrapPanel2</ToolkitComponentName>
66
</PropertyGroup>
77

88
<!-- Sets this up as a toolkit component's sample project -->
99
<Import Project="$(ToolingDirectory)\ToolkitComponent.SampleProject.props" />
1010
<ItemGroup>
11-
<Compile Update="StretchPanelBasicSample.xaml.cs">
12-
<DependentUpon>StretchPanelBasicSample.xaml</DependentUpon>
11+
<Compile Update="WrapPanel2BasicSample.xaml.cs">
12+
<DependentUpon>WrapPanel2BasicSample.xaml</DependentUpon>
1313
</Compile>
1414
</ItemGroup>
1515
</Project>
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
---
2+
title: WrapPannel2
3+
author: Avid29
4+
description: A labs-component candidate for a new WrapPanel implementation.
5+
keywords: WrapPanel, Control, Layout
6+
dev_langs:
7+
- csharp
8+
category: Layouts
9+
subcategory: Panel
10+
discussion-id: 762
11+
issue-id: 763
12+
icon: assets/icon.png
13+
---
14+
15+
# WrapPanel2
16+
17+
The WrapPanel2 is an experiment for a new WrapPanel API using GridLength definitions to define the item's desired sizings.
18+
19+
When stretched along the main axis, the child elements with star-sized GridLength values will proportionally occupy the available space.
20+
21+
When not stretched along the main axis, star-sized child elements will be the smallest size possible while maintaining proportional sizing relative to each other and ensuring that all child elements are fully visible.
22+
23+
24+
> [!Sample WrapPanel2BasicSample]
25+
26+
## Properties
27+
28+
### Fixed Row Length
29+
30+
When `FixedRowLengths` is enabled, all rows/columns will to stretch to the size of the largest row/column in the panel. When this is not enabled, rows/columns will size to their content individually.
31+
32+
### Forced Stretch Method
33+
34+
The `ForcedStretchMethod` property allows you to specify how the panel should handle stretching in rows without star-sized definitions.
35+
36+
#### None
37+
38+
When set to `None`, this panel will not stretch rows/columns that do not have star-sized definitions. When the alignment is set to stretch, and even when fixed row lengths is enabled, the rows/columns without star-sized definitions will size to their content.
39+
40+
#### First
41+
42+
When set the `First`, this panel will stretch the first item in the row/column to occupy the remaining space when needed to comply with stretch alignment.
43+
44+
#### Last
45+
46+
When set to `Last`, this panel will stretch the last item in the row/column to occupy the remaining space when needed to comply with stretch alignment.
47+
48+
#### Equal
49+
50+
When set to `Equal`, this panel will stretch all items in the row/column to occupy the equal space throughout the row when needed to comply with stretch alignment.
51+
52+
#### Proportional
53+
54+
When set to `Proportional`, this panel will stretch all items in the row/column proportionally to their defined size to occupy the remaining space when needed to comply with stretch alignment.
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
<!-- Licensed to the .NET Foundation under one or more agreements. The .NET Foundation licenses this file to you under the MIT license. See the LICENSE file in the project root for more information. -->
2-
<Page x:Class="StretchPanelExperiment.Samples.StretchPanelBasicSample"
2+
<Page x:Class="WrapPanel2Experiment.Samples.WrapPanel2BasicSample"
33
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
44
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
55
xmlns:controls="using:CommunityToolkit.WinUI.Controls"
66
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7-
xmlns:local="using:StretchPanelExperiment.Samples"
7+
xmlns:local="using:WrapPanel2Experiment.Samples"
88
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
99
mc:Ignorable="d">
1010

@@ -21,50 +21,50 @@
2121
</Page.Resources>
2222

2323
<Grid Margin="16" MaxHeight="600">
24-
<controls:StretchPanel Orientation="{x:Bind local:StretchPanelBasicSample.ConvertStringToOrientation(LayoutOrientation), Mode=OneWay}"
24+
<controls:WrapPanel2 Orientation="{x:Bind local:WrapPanel2BasicSample.ConvertStringToOrientation(LayoutOrientation), Mode=OneWay}"
2525
HorizontalSpacing="{x:Bind HorizontalSpacing, Mode=OneWay}"
2626
VerticalSpacing="{x:Bind VerticalSpacing, Mode=OneWay}"
2727
HorizontalAlignment="{x:Bind LayoutHorizontalAlignment, Mode=OneWay}"
2828
VerticalAlignment="{x:Bind LayoutVerticalAlignment, Mode=OneWay}"
2929
FixedRowLengths="{x:Bind FixedRowLengths, Mode=OneWay}"
30-
ForcedStretchMethod="{x:Bind local:StretchPanelBasicSample.ConvertStringToForcedStretchMethod(LayoutForcedStretchMethod), Mode=OneWay}"
31-
OverflowBehavior="{x:Bind local:StretchPanelBasicSample.ConvertStringToOverflowBehavior(LayoutOverflowBehavior), Mode=OneWay}">
32-
<Border controls:StretchPanel.LayoutLength="2*" >
30+
ForcedStretchMethod="{x:Bind local:WrapPanel2BasicSample.ConvertStringToForcedStretchMethod(LayoutForcedStretchMethod), Mode=OneWay}"
31+
OverflowBehavior="{x:Bind local:WrapPanel2BasicSample.ConvertStringToOverflowBehavior(LayoutOverflowBehavior), Mode=OneWay}">
32+
<Border controls:WrapPanel2.LayoutLength="2*" >
3333
<TextBlock Text="2*" HorizontalAlignment="Center"/>
3434
</Border>
35-
<Border controls:StretchPanel.LayoutLength="Auto" >
35+
<Border controls:WrapPanel2.LayoutLength="Auto" >
3636
<TextBlock Text="Auto" HorizontalAlignment="Center"/>
3737
</Border>
38-
<Border controls:StretchPanel.LayoutLength="400" >
38+
<Border controls:WrapPanel2.LayoutLength="400" >
3939
<TextBlock Text="400px" HorizontalAlignment="Center"/>
4040
</Border>
41-
<Border controls:StretchPanel.LayoutLength="1*" >
41+
<Border controls:WrapPanel2.LayoutLength="1*" >
4242
<TextBlock Text="1*" HorizontalAlignment="Center"/>
4343
</Border>
44-
<Border controls:StretchPanel.LayoutLength="200" >
44+
<Border controls:WrapPanel2.LayoutLength="200" >
4545
<TextBlock Text="200px" HorizontalAlignment="Center"/>
4646
</Border>
47-
<Border controls:StretchPanel.LayoutLength="300" >
47+
<Border controls:WrapPanel2.LayoutLength="300" >
4848
<TextBlock Text="300px" HorizontalAlignment="Center"/>
4949
</Border>
50-
<Border controls:StretchPanel.LayoutLength="600">
50+
<Border controls:WrapPanel2.LayoutLength="600">
5151
<TextBlock Text="600px" HorizontalAlignment="Center"/>
5252
</Border>
53-
<Border controls:StretchPanel.LayoutLength="2*">
53+
<Border controls:WrapPanel2.LayoutLength="2*">
5454
<TextBlock Text="2*" HorizontalAlignment="Center"/>
5555
</Border>
56-
<Border controls:StretchPanel.LayoutLength="1.5*">
56+
<Border controls:WrapPanel2.LayoutLength="1.5*">
5757
<TextBlock Text="1.5*" HorizontalAlignment="Center"/>
5858
</Border>
59-
<Border controls:StretchPanel.LayoutLength="Auto">
59+
<Border controls:WrapPanel2.LayoutLength="Auto">
6060
<TextBlock Text="Auto with longer text" HorizontalAlignment="Center"/>
6161
</Border>
62-
<Border controls:StretchPanel.LayoutLength="400">
62+
<Border controls:WrapPanel2.LayoutLength="400">
6363
<TextBlock Text="400px" HorizontalAlignment="Center"/>
6464
</Border>
65-
<Border controls:StretchPanel.LayoutLength="1*">
65+
<Border controls:WrapPanel2.LayoutLength="1*">
6666
<TextBlock Text="1*" HorizontalAlignment="Center"/>
6767
</Border>
68-
</controls:StretchPanel>
68+
</controls:WrapPanel2>
6969
</Grid>
7070
</Page>

components/StretchPanel/samples/StretchPanelBasicSample.xaml.cs renamed to components/WrapPanel2/samples/WrapPanel2BasicSample.xaml.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
using CommunityToolkit.WinUI.Controls;
66

7-
namespace StretchPanelExperiment.Samples;
7+
namespace WrapPanel2Experiment.Samples;
88

99
/// <summary>
1010
/// An example sample page of a custom control inheriting from Panel.
@@ -18,10 +18,10 @@ namespace StretchPanelExperiment.Samples;
1818
[ToolkitSampleMultiChoiceOption("LayoutForcedStretchMethod", "None", "First", "Last", "Equal", "Proportional", Title = "Forced Stretch Method")]
1919
[ToolkitSampleMultiChoiceOption("LayoutOverflowBehavior", "Wrap", "Drop", Title = "Overflow Behavior")]
2020

21-
[ToolkitSample(id: nameof(StretchPanelBasicSample), "Custom control", description: $"A sample for showing how to create and use a {nameof(StretchPanel)} custom control.")]
22-
public sealed partial class StretchPanelBasicSample : Page
21+
[ToolkitSample(id: nameof(WrapPanel2BasicSample), "WrapPanel2 Basic Sample", description: $"A sample for showing how to use a {nameof(WrapPanel2)} panel.")]
22+
public sealed partial class WrapPanel2BasicSample : Page
2323
{
24-
public StretchPanelBasicSample()
24+
public WrapPanel2BasicSample()
2525
{
2626
this.InitializeComponent();
2727
}

components/StretchPanel/src/CommunityToolkit.WinUI.Controls.StretchPanel.csproj renamed to components/WrapPanel2/src/CommunityToolkit.WinUI.Controls.StretchPanel.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22
<Import Project="$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))" Condition="Exists('$([MSBuild]::GetPathOfFileAbove(Directory.Build.props))')" />
33

44
<PropertyGroup>
5-
<ToolkitComponentName>StretchPanel</ToolkitComponentName>
6-
<Description>This package contains StretchPanel.</Description>
5+
<ToolkitComponentName>WrapPanel2</ToolkitComponentName>
6+
<Description>This package contains WrapPanel2.</Description>
77

88
<!-- Rns suffix is required for namespaces shared across projects. See https://github.com/CommunityToolkit/Labs-Windows/issues/152 -->
9-
<RootNamespace>CommunityToolkit.WinUI.Controls.StretchPanelRns</RootNamespace>
9+
<RootNamespace>CommunityToolkit.WinUI.Controls.WrapPanel2Rns</RootNamespace>
1010
</PropertyGroup>
1111

1212
<!-- Sets this up as a toolkit component's source project -->

0 commit comments

Comments
 (0)