Repository navigation
Description
Approved from Discussion #96
Problem Statement (copied from Discussion):
We have various types of experience which need 'gripper bars' in order to provide a user with the ability to resize/drag an area of UI around in an application. These all have similar visual and behavior cues, but may require different logic to manipulate the underlying UI structure.
Overview
This experiment adds the following components:
- SizerBase an abstract base class to centralize logic around input, visuals, and accessibility.
- GridSplitter knows how to manipulate a
Grid's rows/columns - ContentSizer knows how to manipulate the
Width/Heightof anyFrameworkElement - PropertySizer knows how to directly manipulate any bound
doublevalue
Using
You can try it out via the NuGet Packages here:
- UWP: https://dev.azure.com/dotnet/CommunityToolkit/_artifacts/feed/CommunityToolkit-MainLatest/NuGet/CommunityToolkit.Uwp.Controls.Sizers
- WinUI 3: https://dev.azure.com/dotnet/CommunityToolkit/_artifacts/feed/CommunityToolkit-MainLatest/NuGet/CommunityToolkit.WinUI.Controls.Sizers
Read more about Preview Packages here.
This control has moved from Labs to the new main repo.
CommunityToolkit members can also try it out with Codespaces.
## TO DO
- [x] Fix Mouse Extension Cursor change for WASM (was working at one point, think messed up conditional logic again) See #208
- [x] Add some enum/bool for auto hiding the splitter and having it appear on hover (think size should be consistent, so just an animation?)
- [x] WinUI 3 may behave oddly - see https://github.com/microsoft/microsoft-ui-xaml/issues/6847
- [x] Orientation Property #388
Not all these items are required to submit a PR. This list is here to help track what is remaining to implement before a technical review and discussion of moving into the main repository can occur.
## Implementation Requirements
- [x] Working Prototype
- [x] Feature Complete
- [ ] Documentation
- [ ] SizerBase
- [x] ContentSizer
- [x] PropertySizer
- [ ] GridSplitter
- [ ] Samples
- [ ] SizerBase
- [x] ContentSizer
- [x] PropertySizer
- [x] GridSplitter
- [ ] Tests
- [ ] Community Feedback / Usage Testimonies
## Tested Platforms
- [x] UWP
- [x] WinAppSDK / WinUI 3
- [x] Web Assembly (WASM)
- [ ] Android
- [ ] iOS
- [ ] MacOS
- [ ] Linux / GTK
These items can sometimes be done ahead of time, but are usually started and completed after all implementation details are finished.
## Technical Review
- [ ] Accessibility Audit
- [ ] API/Naming Review
- [ ] Code Quality/Style
- [ ] Dependency Review
- [ ] Design/Style Review
- [ ] Final Approval
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
- StatusShow more project fields✅ Done

Activity
[-]🧪 Experiment: SizerBase class for GridSplitter + ContentSizer + PropertySizer[/-][+]🧪 [Experiment] SizerBase class for GridSplitter + ContentSizer + PropertySizer[/+]michael-hawker commentedon Jul 7, 2022
Couple of things I've noticed, looks like I broke the WASM hover implementation again... and we should investigate an auto-collapse behavior mode too.
michael-hawker commentedon Dec 2, 2022
Figured out what was going on with the cursor not properly updating when the Orientation is Horizontal (like in the sample) - regression from current Toolkit version.
It's this code here:
Labs-Windows/labs/SizerBase/src/SizerBase.Properties.cs
Lines 98 to 110 in 9045236
Since we set the value of the dependency property, when the initial pass run on load sets it to
SizeWestEast. Then the detection logic runs andOrientationis changed toHorizontal, but the set gets ignored the 2nd time as the prop has been set...Think this was abstracted in the old code as the inner class held that info.
Here, I think we need to just have the private value tracking what the cursor should be and leave the Cursor property for overrides? Will think about it more and get back to it as a separate fix.
Effects UWP and WASM (basically WinUI 2), Windows App SDK uses a different setup, so I think is uneffected.
michael-hawker commentedon Apr 14, 2023
Behavior for WindowsAppSDK is looking good now on 1.3, will push a PR up shortly, also trying to fix the Cursor orientation bug number #388.
alexfalconflores commentedon Jun 29, 2023
The styling of this control in UWP does not look the same as the styling of WASM or the toolkitlabs.dev page.
In the UWP version it shows an old design.
UWP (xmlns:labs="using:CommunityToolkit.Labs.WinUI" )
toolkitlabs.dev
michael-hawker commentedon Jun 29, 2023
@alexfalconflores are you using the new package (
CommunityToolkit.Uwp.Controls.Sizers) from the Windows repo?alexfalconflores commentedon Jul 1, 2023
I'm using this
https://pkgs.dev.azure.com/dotnet/CommunityToolkit/_packaging/CommunityToolkit-MainLatest/nuget/v3/index.json
niels9001 commentedon Jul 3, 2023
@alexfalconflores Looks like you are using the
Sizersfrom Labs.. we have recently moved these to the main Toolkit and made any updates there.So, instead of using CommunityToolkit.Labs.Uwp.Sizers use the CommunityToolkit.Uwp.Sizers package.. it's on the same preview Nuget feed!
alexfalconflores commentedon Jul 4, 2023
Thanks for the help @niels9001 and @michael-hawker. The new control design looks great. Keep it up.
Do you know when UWP will support .net 7 or 8?
CommunityToolkit.Uwp.Controls.Sizers . nuget prerelease
michael-hawker commentedon Jul 5, 2023
@alexfalconflores see discussions here and here - if you need the latest .NET then you'd want to port to WinUI 3 (which is what we're making all our components work with both to make it easy to do). If you just need newer language features for C#, look at PolySharp.
michael-hawker commentedon Sep 28, 2023
This was shipped in the 8.0 Release, please update to use that version of the component. Any further issues/requests should start in the main repository.
Fabi12345 commentedon Oct 24, 2024
So I always have to point the cursor to the center of that splitter despite it requires the whole space along the container? And the normal GridSplitter belongs to a deprecated package, but has no hover function, sigh, WinUI has become a mess.
niels9001 commentedon Oct 24, 2024
@Fabi12345 This issue is closed, so it might not reflect the latest changes.
Recording.2024-10-24.160306.mp4
GridSplitterbelongs to the Windows Community Toolkit 8.x packages. Those are not deprecated at all: https://www.nuget.org/packages/CommunityToolkit.WinUI.Controls.SizersWhat do you mean with 'hover function'? There's a hover state in the sizer controls in case you want to customize that!
You can install the Windows Community Gallery app from the Store here, it has all of the information you'd need: https://www.microsoft.com/store/productId/9NBLGGH4TLCQ
Fabi12345 commentedon Oct 24, 2024
Oh ok, that looks better, gonna try it, thanks!