-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add MultiColumnsStackPanel #3381
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
vgromfeld
wants to merge
34
commits into
CommunityToolkit:main
Choose a base branch
from
vgromfeld:multiColumnsStackPanel
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+477
−1
Draft
Changes from all commits
Commits
Show all changes
34 commits
Select commit
Hold shift + click to select a range
48825c8
add sample page + implementation skeleton
vgromfeld e05e47c
add properties binding
vgromfeld 9da8406
first drop of implementation
vgromfeld 112a5d3
improve arrange logic
vgromfeld e70cf76
algorithm is almost working (but not efficient)
vgromfeld 77cba20
rewrite algorithm
vgromfeld b5aa4fc
algorithm is working but partition is not optimal
vgromfeld d60ed83
fix algorithm
vgromfeld a6d8db1
fix comment
vgromfeld bd5a116
add items spacing support
vgromfeld 809917a
fix no children case
vgromfeld 8dd4efa
fix algorithm
vgromfeld f6a9384
add scroll viewer viewport support
vgromfeld 340b29e
update sample code
vgromfeld 29aa3e4
fix pixel rounding issue
vgromfeld 6d39cbf
add horizontal alignment support
vgromfeld e993503
update configuration
vgromfeld 8f6539f
update comments
vgromfeld c48c746
renamed dependency properties
vgromfeld af071eb
merge from master
vgromfeld 848288a
add horizontal padding support
vgromfeld 0ef895a
add vertical padding support
vgromfeld f3c3111
Merge branch 'master' into multiColumnsStackPanel
vgromfeld 1762462
Merge branch 'master' into multiColumnsStackPanel
vgromfeld 8856498
fix stylecop issues
vgromfeld 05d3b08
Remove HorizontalContentAlignment property
vgromfeld 12e4fa2
Merge branch 'multiColumnsStackPanel' of https://github.com/vgromfeld…
vgromfeld 1cfaf2d
merge from master
vgromfeld aabefb2
Merge branch 'master' into multiColumnsStackPanel
vgromfeld 900d6e6
rename control to FormPanel
vgromfeld d2703af
update control height to get a better alignment
vgromfeld 846a21c
pr comments
vgromfeld a9186aa
Merge branch 'master' into multiColumnsStackPanel
Rosuavio 38219fa
Merge branch 'master' into multiColumnsStackPanel
Kyaa-dost File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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
Binary file added
BIN
+888 Bytes
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/FormPanel/FormPanel.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions
64
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/FormPanel/FormPanelCode.bind
This file contains hidden or 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,64 @@ | ||
| <Page | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| mc:Ignorable="d"> | ||
|
|
||
| <Grid> | ||
| <ScrollViewer HorizontalScrollBarVisibility="Disabled" | ||
| HorizontalScrollMode="Disabled" | ||
| VerticalScrollBarVisibility="Auto" | ||
| VerticalScrollMode="Auto"> | ||
| <controls:FormPanel HorizontalAlignment="Left" | ||
| VerticalAlignment="Top" | ||
| HorizontalSpacing="@[HorizontalSpacing:Slider:12:0-120]" | ||
| VerticalSpacing="@[VerticalSpacing:Slider:8:0-64]" | ||
| MaxColumnWidth="@[MaxColumnWidth:Slider:240:0-500]" | ||
| Padding="@[Padding:Thickness:0,0,0,0]@"> | ||
| <TextBox Header="Field 1" /> | ||
| <TextBox Header="Field 2" /> | ||
| <TextBox Height="118" | ||
| Header="Field 3" /> | ||
| <TextBox Header="Field 4" /> | ||
| <TextBox Header="Field 5" /> | ||
| <TextBox Height="118" | ||
| Header="Field 6" /> | ||
| <TextBox Height="181" | ||
| Header="Field 7" /> | ||
| <TextBox Header="Field 8" /> | ||
| <TextBox Height="118" | ||
| Header="Field 9" /> | ||
| <TextBox Header="Field 10" /> | ||
| <TextBox Header="Field 11" /> | ||
| <TextBox Header="Field 12" /> | ||
| <TextBox Header="Field 13" /> | ||
| <TextBox Height="181" | ||
| Header="Field 14" /> | ||
| <TextBox Header="Field 15" /> | ||
| <TextBox Height="244" | ||
| Header="Field 16" /> | ||
| <TextBox Header="Field 17" /> | ||
| <TextBox Header="Field 18" /> | ||
| <TextBox Header="Field 19" /> | ||
| <TextBox Height="181" | ||
| Header="Field 20" /> | ||
| <TextBox Header="Field 21" /> | ||
| <TextBox Height="118" | ||
| Header="Field 22" /> | ||
| <TextBox Header="Field 23" /> | ||
| <TextBox Height="244" | ||
| Header="Field 24" /> | ||
| <TextBox Header="Field 25" /> | ||
| <TextBox Height="181" | ||
| Header="Field 26" /> | ||
| <TextBox Header="Field 27" /> | ||
| <TextBox Header="Field 28" /> | ||
| <TextBox Height="118" | ||
| Header="Field 29" /> | ||
| <TextBox Header="Field 30" /> | ||
| </controls:FormPanel> | ||
| </ScrollViewer> | ||
| </Grid> | ||
| </Page> | ||
65 changes: 65 additions & 0 deletions
65
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/FormPanel/FormPanelPage.xaml
This file contains hidden or 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,65 @@ | ||
| <Page x:Class="Microsoft.Toolkit.Uwp.SampleApp.SamplePages.FormPanelPage" | ||
| xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
| xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
| xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls" | ||
| xmlns:d="http://schemas.microsoft.com/expression/blend/2008" | ||
| xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" | ||
| Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" | ||
| mc:Ignorable="d"> | ||
|
|
||
| <Grid> | ||
| <ScrollViewer HorizontalScrollBarVisibility="Disabled" | ||
| HorizontalScrollMode="Disabled" | ||
| VerticalScrollBarVisibility="Auto" | ||
| VerticalScrollMode="Auto"> | ||
| <controls:FormPanel Padding="0" | ||
| HorizontalAlignment="Left" | ||
| VerticalAlignment="Top" | ||
| HorizontalSpacing="12" | ||
| MaxColumnWidth="240" | ||
| VerticalSpacing="8"> | ||
| <TextBox Header="Field 1" /> | ||
| <TextBox Header="Field 2" /> | ||
| <TextBox Height="118" | ||
| Header="Field 3" /> | ||
| <TextBox Header="Field 4" /> | ||
| <TextBox Header="Field 5" /> | ||
| <TextBox Height="118" | ||
| Header="Field 6" /> | ||
| <TextBox Height="181" | ||
| Header="Field 7" /> | ||
| <TextBox Header="Field 8" /> | ||
| <TextBox Height="118" | ||
| Header="Field 9" /> | ||
| <TextBox Header="Field 10" /> | ||
| <TextBox Header="Field 11" /> | ||
| <TextBox Header="Field 12" /> | ||
| <TextBox Header="Field 13" /> | ||
| <TextBox Height="181" | ||
| Header="Field 14" /> | ||
| <TextBox Header="Field 15" /> | ||
| <TextBox Height="244" | ||
| Header="Field 16" /> | ||
| <TextBox Header="Field 17" /> | ||
| <TextBox Header="Field 18" /> | ||
| <TextBox Header="Field 19" /> | ||
| <TextBox Height="181" | ||
| Header="Field 20" /> | ||
| <TextBox Header="Field 21" /> | ||
| <TextBox Height="118" | ||
| Header="Field 22" /> | ||
| <TextBox Header="Field 23" /> | ||
| <TextBox Height="244" | ||
| Header="Field 24" /> | ||
| <TextBox Header="Field 25" /> | ||
| <TextBox Height="181" | ||
| Header="Field 26" /> | ||
| <TextBox Header="Field 27" /> | ||
| <TextBox Header="Field 28" /> | ||
| <TextBox Height="118" | ||
| Header="Field 29" /> | ||
| <TextBox Header="Field 30" /> | ||
| </controls:FormPanel> | ||
| </ScrollViewer> | ||
| </Grid> | ||
| </Page> |
16 changes: 16 additions & 0 deletions
16
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/FormPanel/FormPanelPage.xaml.cs
This file contains hidden or 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,16 @@ | ||
| // 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. | ||
|
|
||
| using Windows.UI.Xaml.Controls; | ||
|
|
||
| namespace Microsoft.Toolkit.Uwp.SampleApp.SamplePages | ||
| { | ||
| /// <summary> | ||
| /// A page that shows how to use the FormPanel. | ||
| /// </summary> | ||
| public sealed partial class FormPanelPage : Page | ||
| { | ||
| public FormPanelPage() => InitializeComponent(); | ||
| } | ||
| } |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be best to generate these in code with random heights and allow the user to add new textboxes. Would be better for testing.