Skip to content
This repository was archived by the owner on Feb 25, 2026. It is now read-only.
This repository was archived by the owner on Feb 25, 2026. It is now read-only.

[Feature] Split up the controls package. #3594

Description

@Rosuavio

Describe the problem this feature would solve

There are many different kinds of controls in the controls package and there are many different levels of abstraction between the controls.

From a technical perspective, users have to pull in the whole package and all its dependencies (like Win2d and xmal.behaviors) just to get access to simple controls (like WrapPanel).

From a perspective of usability, having all our controls grouped together under "controls"

  1. Makes the library as a whole less "understandable" as only a very general theme unifies it and consumers are not introduced to a specific domain.
  2. Makes it harder to find our controls that do address specific domains in collections of packages. As in if a user is searching for a package to help with "layout" related tasks they most likely won't stumble across our package even though we have a substantial group of controls/panels that only address layout.

Describe the solution

Split the controls package.

We can either split things based on their "weight", splitting general/minimally dependent/simple controls from opinionated/heavily dependent/complex controls.

Or split the controls based on the domains or problem spaces they live in. Domains like "Layout", "Input" or maybe "Image capture/creation/examination/manipulation"

Whatever way seems like the best, I want to see the package split up into more focused categories.

Describe alternatives you've considered

  1. Keep the package as it is.
  2. Have a separate package per control.

Analysis

Control For Layout Standalone Needs content Provides Interactions Styleless Major Deps
AdaptiveGridView x x x
DockPanel x x x
StaggeredPanel x x x
UniformGrid x x x
WrapPanel x x x
SwitchPresenter x x x
LayoutTransformControl x x
HeaderedContentControl x x
HeaderedItemsControl x x
Carousel x x x
MasterDetailsView ? x x
OrbitView ? x x Animation #3627
BladeView ? x x
Expander ? x x
InAppNotification ? x x
RotatorTile ? x
DropShadowPanel x
ScrollHeader x Animation, Behaviors
TileControl ? x Animation #3633
TextToolbar ? x
GridSplitter ? x
ImageEx x
Menu x x
Loading x
RadialProgressBar x
CameraPreview x
ColorPicker x x
RadialGauge x x
RangeSelector x x Animation #3611
RemoteDevicePicker x x
TokenizingTextBox x x
ImageCropper x x Win2d
Eyedropper x x Win2d
InfiniteCanvas x x Win2d

Related to #3145

Activity

  1. Rosuavio commented on Dec 4, 2020

    @Rosuavio
    ContributorAuthor

    I should mention my personal thoughts are that

    1. We should group them based on domains.
    2. We should at least split off a "Layout" package containing most of the controls that are labeled "For Layout" or "Needs content" as most of them are very lightweight and "layout" seems like a very important domain.
  2. michael-hawker commented on Dec 4, 2020

    @michael-hawker
    Member

    @LanceMcCarthy pointed us to the Xamarin Forms breakdown here: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/controls/views

    This has Expander as more of a 'Content' control/View vs. a Layout specifically.

    Wonder if we want to be more fine-grained with 'Needs Content' to be a specific 'Content' vs. 'Items'?

  3. mrlacey commented on Dec 4, 2020

    @mrlacey
    Contributor

    The sample app already has groupings, but not everything listed above shows up in the sample app :/

  4. Rosuavio commented on Dec 4, 2020

    @Rosuavio
    ContributorAuthor

    Other than the major categories, I'm curious what everyone thinks of having a separate "Panels" package separate from any "Layout" package, as they seem to distinguish themselves as not having any really visual appearance just a strategy for placing children.

    Particularly I think AdaptiveGridView, DockPanel, StaggeredPanel, UniformGrid, WrapPanel would be our "Panels" (or whatever we want to name it). But something like the Carousel or the OribitView already has a strong visual style and in comparison to the "Panels" and is more opinionated/less general purpose.

  5. michael-hawker commented on Dec 4, 2020

    @michael-hawker
    Member

    The sample app already has groupings, but not everything listed above shows up in the sample app :/

    @mrlacey yeah our Sample App groupings are a bit 'fuzzy' too, so they may need to be restructured based on decisions here. But it could be an interesting thing to evaluate what we did in the past there with this matrix.

    Curiously, besides SwitchPresenter was something else missing from the Sample App? (I need to create the sample for that control still it's new for 7.0.)

  6. mrlacey commented on Dec 4, 2020

    @mrlacey
    Contributor

    Curiously, besides SwitchPresenter was something else missing from the Sample App? (I need to create the sample for that control still it's new for 7.0.)

    just SwitchPresenter

  7. mrlacey commented on Dec 4, 2020

    @mrlacey
    Contributor

    Are there separate plans (& issues) for trying to remove the dependencies? If there are alternatives?

  8. michael-hawker commented on Dec 4, 2020

    @michael-hawker
    Member

    @mrlacey the only one I believe I filed so far is #3578 for the Animations package. I thought it was just RangeSelector and ScrollHeader, so that issue needs more details about what OrbitView and TileControl use.

  9. mrlacey commented on Dec 4, 2020

    @mrlacey
    Contributor

    Other than the major categories, I'm curious what everyone thinks of having a separate "Panels" package separate from any "Layout" package, as they seem to distinguish themselves as not having any really visual appearance just a strategy for placing children.

    Particularly I think AdaptiveGridView, DockPanel, StaggeredPanel, UniformGrid, WrapPanel would be our "Panels" (or whatever we want to name it). But something like the Carousel or the OribitView already has a strong visual style and in comparison to the "Panels" and is more opinionated/less general purpose.

    I would avoid this unless there is a good reason to have them in separate packages. While breaking into more packages makes each package smaller it also adds complexity to finding and selecting the right package.
    As a consumer of the packages I wouldn't want to have to stop and work out (guess) whether I needed Controls.Layout or Controls.Panels. This could get particularly confusing if some controls ending Grid are in the Panels package and some another.
    And what about DropShadowPanel? That is all about visual appearance.

  10. LanceMcCarthy commented on Dec 4, 2020

    @LanceMcCarthy

    I would avoid this unless there is a good reason to have them in separate packages. While breaking into more packages makes each package smaller it also adds complexity to finding and selecting the right package.

    I agree with this. UWP has a linker and strips out unused stuff during release compilation with .NETNative. so it's not like having more dependencies is going to bloat your app.

    This is more about developer and tooling experience, right? So, where is the balance between having a smaller dependency tree vs needing to search around for the right packages.

  11. michael-hawker commented on Dec 4, 2020

    @michael-hawker
    Member

    @mrlacey good points. We also already have a Microsoft.Toolkit.Uwp.UI.Controls.Layout package as well that's explicitly related to WinUI ItemsRepeater.

    Panels would be a tricky sell, especially with DropShadowPanel which isn't really a Panel...

    I was thinking probably we'd have names like Base, Core, or Primitives, but those aren't that descriptive in helping find things. That's partly we still want the uber Controls` package which includes them all still to be there. That way knowing what's in each of these sub-packages is more of an advanced optimization step.

    I agree with this. UWP has a linker and strips out unused stuff during release compilation with .NETNative. so it's not like having more dependencies is going to bloat your app.

    This is more about developer and tooling experience, right? So, where is the balance between having a smaller dependency tree vs needing to search around for the right packages.

    @LanceMcCarthy not all the things for XAML get stripped as the XAML metadata hold implicit references I believe; so those benefits aren't as apparent for the Controls package. @vgromfeld has been investigating this and can explain a bit more the technical details. Ref: #3145

  12. Rosuavio commented on Dec 4, 2020

    @Rosuavio
    ContributorAuthor

    @mrlacey the only one I believe I filed so far is #3578 for the Animations package. I thought it was just RangeSelector and ScrollHeader, so that issue needs more details about what OrbitView and TileControl use.

    I am putting together a list of their significant dependencies right now, it's clearer than my branches.

  13. Rosuavio commented on Dec 4, 2020

    @Rosuavio
    ContributorAuthor
  14. 14 remaining items

  15. michael-hawker commented on Feb 1, 2021

    @michael-hawker
    Member

    @RosarioPulella thought a bit more and decided to take a look at the WinUI categories from their control gallery and try and condense them down:

    • Input + Date & Time + Text + Status and Info (this last one could also fit in the next bucket though there's some overlap)
    • Menus & Toolbars + Dialogs & Flyouts
    • Collections + Layout + Navigation + Scrolling
    • Media (though we already use Media for Win2D)

    We kind of use a similar split in our Sample App. Wondering if we could get a cleaner split of taking the rest of our stuff beyond Primitives and Media and segmenting it into 3: Input, Layout, and 'Chrome'?

    Not sure what to call the last one. It's almost like Adornments... but that means something else from WPF/XAML land.

    I'm also wondering if we just add to the existing Layout package if we plan to end-up with the WinUI dependency in the future anyway...

    Let me know any thoughts you have in the morning and we'll sync during the day to figure out a plan for the week.

  16. Rosuavio commented on Feb 1, 2021

    @Rosuavio
    ContributorAuthor

    Interesting, so maybe the controls would split into the categories like this?

    • Input - ColorPicker, RadialGauge, RangeSelector, RemoteDevicePicker, TokenizingTextBox
    • Layout -LayoutTransformControl, HeaderedContentControl, HeaderedItemsControl, ListDetailsView, Carousel, OrbitView, BladeView, Expander, GridSplitter
    • "Chrome" - RotatorTile, DropShadowPanel, TileControl, ImageEx, Loading, RadialProgressBar, CameraPreview

    What about these other controls?
    InAppNotification, Menu, TextToolbar

  17. michael-hawker commented on Feb 1, 2021

    @michael-hawker
    Member

    Yeah, InAppNotification, Menu, and TextToolbar would be in 'Chrome' as well. Wonder if we just call that the 'Core' package and just pull out the Layout and Input items?

    @RosarioPulella thoughts?

  18. Rosuavio commented on Feb 1, 2021

    @Rosuavio
    ContributorAuthor

    Well as far as categorization, its always easiest to have a "Un-catogrized" bucket. While Its would be hard to figure out whats in "Core" from the name I think its worth splitting the others controls out. Also if there was no "Other"-ish bucket then it would be a bigger barrier to entry for contributes. If contributors want to add a control and it does not fit in one of the established categories, they would have an easier time just adding it to "Core" than creating a new package. If a new control should be in a different or new package and they try to add to "Core" we can help them from there, rather then them having to deal with that thought process upfront and possibly on there own.

  19. michael-hawker commented on Feb 1, 2021

    @michael-hawker
    Member

    If a new control should be in a different or new package and they try to add to "Core" we can help them from there, rather then them having to deal with that thought process upfront and possibly on there own.

    Yeah, and part of this would be sorted out in an initial discussion/issue before we get to a PR.

    I think the last part is if we want to have two different 'Layout' packages or re-use the one we have. My only concern is that the current Layout package is pretty specific and small as there's no XAML bits...

  20. Rosuavio commented on Feb 1, 2021

    @Rosuavio
    ContributorAuthor

    Yeah... And between 'Primitives' and the new 'Layout', The controls in 'Primitives' provides no interactions unlike some of the controls in 'Layout'.

  21. michael-hawker commented on Feb 4, 2021

    @michael-hawker
    Member

    Something to think about... We now have a 'Primitives' package, but we had also put some helper bits in a 'Controls.Primitives' namespace (like the ColorPickerSlider)...

    How do we reconcile?

    Should our 'Primitives' package be a more aptly named 'Styleless' or do we change the namespace to be something else???

    @windows-toolkit/toolkitteam thoughts?

  22. Rosuavio commented on Feb 4, 2021

    @Rosuavio
    ContributorAuthor

    Well do we eventually want to put our controls in different namespaces for each package?

  23. ghost added a commit that references this issue on Feb 4, 2021
  24. michael-hawker commented on Feb 4, 2021

    @michael-hawker
    Member

    @RosarioPulella they'll all stay in the Controls namespace, as the point of the uber-Controls package is that if you're just getting started you don't know that they're all in sub-packages. The sub-packages are really just a later step for app developers to optimize package sizes later.

    I'm wondering if we just move the ColorPickerSlider to the main namespace but add the Browsable/EditorBrowsable component attributes to hide it from the editor?

  25. ghost locked as resolved and limited conversation to collaborators on Apr 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions