-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
New ListViewBase extensions - SmoothScrollIntoView #1499
Comments
Seems interesting to me :) maybe we can also include delay in scroll so the developer can control the scroll speed. let see what the community members think |
Based on discussions on this topic I've had, you probably want to make the ScrollIfVisibile a Boolean to separate it from where to scroll the object to. e.g. you may want to scroll the item to the center, but only if it's not already visible. |
@IbraheemOsama We should add 'Speed' (pixels per second) instead for 'Delay' or 'Duration'. So the duration of the animation will be @michael-hawker I like the idea and it would be easy to do. I am sorry guys. I can't create a PR for this because I don't think I have enough knowledge to do it. I have never created a helper or control other than for my own use. |
@Vijay-Nirmal everyone had this moment of 'First PR' :) when I created a gitHub account I didn't have any previous PR :P |
@Vijay-Nirmal, please let us know if you would be able to submit a PR for this. Most of us would be more than happy to help :) |
Thanks, but I don't think I have enough knowledge about UWP development. I am sorry I can't create a PR for this. But in the future, when I am well versed in UWP development, I will create a PR to create a different feature. |
@nmetulev I can take a look at this as soon as possible, if you want? This will be an exciting adventure. |
Feel free to take this one @theweavrs |
@theweavrs, were you planing on implementing this one? If so, I'll set the milestone for 2.1 |
@nmetulev I will do it. When I build the solution it gives me errors and warnings. I didn't change any code. Here is the full error list |
That's great @Vijay-Nirmal. This is a known issue with the new design project. We believe it's a VS/NuGet bug and those errors can be safely ignored. |
For some reason, I can't navigate to my helper page. Update: I fixed navigation part. Now, .bind file is causing an exception. Also in @nmetulev Is this method should be part of @nmetulev Is there is a way to manually create controls in Property panel and link it to because @IbraheemOsama I use |
@Vijay-Nirmal since it's effectively an extension to Also, I didn't see As for the properties panel, they get added from looking at the .bind file. If you have a reference to the 'CurrentSample' then you could modify the descriptor manually after the XAML rendered event. @nmetulev do we expose that to the Sample Page? I couldn't find an example. I'd see the sample maybe exposing the placement enum and the checkboxes and then just having a button (with the Shell.Current.RegisterNewCommand) which 'Scrolls Into View'? |
@michael-hawker Good idea.
No. I have finished the whole implementation except sample app part. It is on my local computer.
But this is a method I don't have xaml .bind only c# .bind to show the syntax of the method. I have planned to remove the c# .bind because syntax can be easily seen on the documentation panel. |
@michael-hawker Hmm... It's not a good idea. If I want to create this helper method inside Extensions/ListViewBase then do I have to share the same sample page? If not, I will create a separate page (SmoothScrollIntoView.xaml) but the file name (ListViewBase.Methods.cs) and the sample page name (SmoothScrollIntoView) won't be same. This may cause some confusion. |
@Vijay-Nirmal We don't really explicitly point to where the code lives via sample name, it's just been a convention. That's what the doc tab is supposed to be for. However, @nmetulev was planning to expand the samples so that each page could provide more than one sample, so that would be another solution because I would think code structure wise it would make sense if it's a ListViewBase method to stay with ListViewBase. @nmetulev thoughts? (Also, when we do get to building the multiple samples per page, they should still be individually searchable for discoverability...?) |
@michael-hawker So the only option is to wait until next sample app update? or I will create a PR with a separate sample page and after update sample app update we can merge the two pages.
Use folders like live tiles folder when we click on it, it will show all the pages containing in that folder. |
@michael-hawker Since this is an extension method I want to change LisViewBase class as How can I resolve it? |
Makes sense for this to be in the ListViewBaseExtensions class. There is a naming collision between the extension class and the ListViewBase platform class (we are going to resolve that with #1561), I think that's what you are running into here. #1438 is tracking multiple samples per feature. I'd recommend adding the sample on the existing page if possible and then we can separate them in a it's own sample once possible. |
Since I am creating Extension methods, I want a static class. So even though I use
Yes, it is possible but it will not a good idea because it will not explain the method properly. |
@nmetulev What shall I do? |
Seeing how we will be changing the ListVIewBase class to ListViewBaseEx, it's a good opportunity to make it a static class. My recommendation here is to create a new static class in the ListViewBase folder called ListViewBaseEx and add your code there. I can then go in an mark the old class obsolete and move the appropriate methods there to prepare them for 3.0. What do you think? |
Actually, per this comment, we will not be using the Ex extension, so the name will go back to ListViewBaseExtensions per the naming convention. Is there a reason why the class needs to be static for your extensions @Vijay-Nirmal ? |
@nmetulev Because I am creating an extension method for ListViewBase just link LogicalTree for FrameworkElement. |
@nmetulev Any ideas? |
I have updated my SmoothScrollingHelper repository. If I use I can't debug this. I have tested all the value at runtime using breakpoints. My code is working properly. I think it is a bug with |
@Vijay-Nirmal What's the status on this? |
@Kyaa-dost I will do it. Currently, I am working in ASP.Net Core and .Net Core Framework. I can't find my motivation to get back to UWP. But I promise my self that I will do this. ✌ |
@Vijay-Nirmal, not a problem at all. Thank you so much for responding 🙂 |
Can I use Visual Studio 2019? Or Visual Studio 2017 only. Because I am getting the below issue in VS 2019.
I don't have Visual Studio 2017 installed. So I can't test it. |
@Vijay-Nirmal It has to do with the certain SDK dependency which VS 2019 doesn't install by default. See the issue and resolution provided by Michael. |
@michael-hawker Is there a way to create Properties Panel items from code (not from xaml.bind)? Because I need to get the inputs for my extension method. Update: Currently, I am using hidden Update: Found the reason for |
@Kyaa-dost @michael-hawker Any update? |
@michael-hawker Update? |
@Vijay-Nirmal can you summarize what items are you waiting on from me at the moment? It sounds like you worked around most of your sample app issues? If you're pretty close to completeness, can you open a Draft PR with the changes? It'll make it easier to review and point-out any assistance with any open questions you have as well. Thanks! |
@michael-hawker I have created Draft PR #3222. I have two questions
https://github.com/windows-toolkit/WindowsCommunityToolkit/blob/9ad0b20029c9266d0f3d162520fe549a9a9243fe/Microsoft.Toolkit.Uwp.SampleApp/SamplePages/ListViewExtensions/ListViewExtensionsXaml.bind#L20-L21
|
SmoothScrollIntoView extensions allow scrolling the item into the view with animation.
Properties
Sample code - SmoothScrollingHelper
The text was updated successfully, but these errors were encountered: