Skip to content
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

Add support for ItemsControl Header and Footer #10745

Closed
jeromelaban opened this issue Dec 16, 2022 · 2 comments · Fixed by #13507
Closed

Add support for ItemsControl Header and Footer #10745

jeromelaban opened this issue Dec 16, 2022 · 2 comments · Fixed by #13507
Assignees
Labels
area/listview 📃 Categorizes an issue or PR as relevant to the ListView control difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding kind/enhancement New feature or request project/items 🧾 Categorizes an issue or PR as relevant to items (ItemsControl, ItemsRepeater, ...) project/layout 🧱 Categorizes an issue or PR as relevant to layouting and containers (Measure/Arrange, Collections,..)

Comments

@jeromelaban
Copy link
Member

Originally posted by @michael-hawker in #1979 (comment)

We could do a bunch of extra work with a StackPanel and ContentPresenters, but it's super simple to hook-in to the existing properties on the ItemsPresenter for this scenario:

     <ItemsPresenter win:Footer="{TemplateBinding ItemsFooter}"
                     win:Header="{TemplateBinding ItemsHeader}"
                     TabFocusNavigation="Local" />
@jeromelaban jeromelaban added kind/enhancement New feature or request project/layout 🧱 Categorizes an issue or PR as relevant to layouting and containers (Measure/Arrange, Collections,..) labels Dec 16, 2022
@michael-hawker
Copy link

Thanks @jeromelaban! We stumbled upon this one by accident, we didn't even realize ItemsPresenter had Header and Footer properties to use. But it played really well into our new scenario for the SettingsExpander control and presenting an item at the end of the list. It was super simple to plug-in our new properties too, and worked like a charm in UWP and Windows App SDK:

image

Appreciate you opening a new tracking issue for this.

@michael-hawker
Copy link

FYI, I was just looking at the Toolkit's HeaderedItemsControl and realized that it'll be simpler and better aligned to ListView if we use the Header property of the ItemsPresenter itself vs. our own ContentPresenter. Simplifies the visual tree for this light-weight control as well.

@MartinZikmund MartinZikmund self-assigned this Jun 21, 2023
@MartinZikmund MartinZikmund changed the title Add support for ItemsControl Header and Footer Add support for ItemsControl Header and Footer Aug 23, 2023
@MartinZikmund MartinZikmund added area/listview 📃 Categorizes an issue or PR as relevant to the ListView control project/items 🧾 Categorizes an issue or PR as relevant to items (ItemsControl, ItemsRepeater, ...) difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding labels Aug 23, 2023
@jeromelaban jeromelaban assigned ramezgerges and unassigned Xiaoy312 Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/listview 📃 Categorizes an issue or PR as relevant to the ListView control difficulty/challenging 🤯 Categorizes an issue for which the difficulty level is reachable with internals understanding kind/enhancement New feature or request project/items 🧾 Categorizes an issue or PR as relevant to items (ItemsControl, ItemsRepeater, ...) project/layout 🧱 Categorizes an issue or PR as relevant to layouting and containers (Measure/Arrange, Collections,..)
Projects
None yet
5 participants