-
Notifications
You must be signed in to change notification settings - Fork 10
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
MAIN: Update lists for better dynamic lists, pagination, async #150
Conversation
* I put the sample pages into a single top-level command, so deploying that extension didn't add 5 top-level commands to your palette * I tightened up some of the phrasing for the samples, and the builtins, to be less repetitive * I added a few icons * I made the markdown sample longer (and work more reliably) * and also thank you Hawker for auto-format on save, you the man (targets #142)
As discussed in #121. Adds a new `IListItem.TextToSuggest` property. If an extension populates that, and the user hits right-arrow when the item is selected, we'll set the `SearchText` to that text. I didn't give it a UI treatment, because 1. I'm not good at XAML 2. As noted in #121 (comment), there's complicated edge cases here. You have to track what's actually been typed, and then also have a ghost suggestion for the very first item (before the user types/up/downs at all). I didn't think it was valuable to implement that right now before we have A Real App. * targets #144 * which targets #142 * which targets #141 and those guys are all merged as of #150
private ScrollViewer? FindScrollViewer(DependencyObject parent) | ||
{ | ||
if (parent is ScrollViewer) | ||
{ | ||
return (ScrollViewer)parent; | ||
} | ||
|
||
for (var i = 0; i < VisualTreeHelper.GetChildrenCount(parent); i++) | ||
{ | ||
var child = VisualTreeHelper.GetChild(parent, i); | ||
var result = FindScrollViewer(child); | ||
if (result != null) | ||
{ | ||
return result; | ||
} | ||
} | ||
|
||
return null; |
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.
FYI, we have helpers in the WCT for this, so if you're in C# never write these again 😋
ItemsList.FindAscendent<ScrollViewer>();
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.
oh thank god 😅
This felt terribly dirty writing it, but it seemed like it was the only way to do it 🤷
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.
It's in the CommunityToolkit.WinUI.Extensions
package 🙂
Originally in #142 and #144, but github didn't automatically change the base branch 😨
As discussed in #77.
Biggest change is that
IDynamicListPage
doesn't haveGetItems(String query)
anymore. Instead, the host will call theSearchText
setter, and the list can raiseItemsChanged
to let the host know to callGetItems
againSee src/modules/cmdpal/Exts/EverythingExtension/Pages/EverythingExtensionPage.cs for an example of how to update dynamic extensions.
Closes #131
Closes #77