Filter Xamarin.Forms CollectionView with ObservableCollection

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024

Комментарии • 85

  • @Avandarre
    @Avandarre 11 месяцев назад

    Thank you for this video. It took me some time to figure out how to convert your example to MVVM, but you gave me all the clues to figure it out myself. Well presented & informative!

    • @jfversluis
      @jfversluis  11 месяцев назад

      Appreciate it thanks! Glad you were able to make it work!

  • @shobanan6712
    @shobanan6712 Год назад +1

    Hello Gerald. It was a wonderful video and i hope all of your video contents will be very useful and help us. Here ,i am struggling with the progress bar without using nugget packages in MAUI MVVM with displaying the data, contains from the database. I want to animate the progress bar value based on the value increase or decrease. Please help me. Thanks in advance.

  • @usamaelhamed4324
    @usamaelhamed4324 3 года назад +1

    Thanks for this PRO PRO TIP, I have a question, if I am using a picker with the number of pages of my listview, I need to pick a page and move the listview to that corresponding page keeping the listview with all the items, like a book, Thanks.

    • @jfversluis
      @jfversluis  3 года назад

      Interesting use-case! I think the ListView has a ScrollTo or something, so you need to come up with some index corresponding between the Picker and the items in the ListView and depending on what is selected scroll to the right place :)

  • @iacido
    @iacido 3 года назад

    First, THANK YOU! please keep creating videos like this. So, I'm trying to apply the same approach to filter data in a collection and works fantastic. However, there is a huge performance issue when it tries to filter from an ObservableCollection of 500+ rows. Is there a way to improve that somehow?

    • @iacido
      @iacido 3 года назад

      Well, it appears, I fixed the performance issue by using ObservableRangeCollection from XCT.
      LocationsToDisplay.Clear();
      LocationsToDisplay.AddRange(filteredLocations);

    • @iacido
      @iacido 3 года назад

      However, filtering + infinity scrolling appear not to play well hehe!

    • @iacido
      @iacido 3 года назад

      After some tricky code changes, I made it work with the combination of both. Thanks @Gerald

    • @jfversluis
      @jfversluis  3 года назад +1

      Glad I could act as your rubber duck and you figured it out 😄

  • @TheGreatGamester
    @TheGreatGamester 2 года назад

    What method should I use if I am trying to search a collection? I plan to store user inputs throug sqlite from entries and then display a list which is searched through by those entries. I am struggling to understand how to do this and any help would be nice. If you need the source code I can also provide that.

  • @e.seighart607
    @e.seighart607 2 года назад

    Greetings. Great video. Question, but what if I want to show the filters for the words only after typing 3 letters? Thanks

    • @jfversluis
      @jfversluis  2 года назад

      Check out the amazing user stopped typing behavior in the Xamarin Community Toolkit for that: ruclips.net/video/OPDYAfPUv1g/видео.html

  • @elvinvicente7122
    @elvinvicente7122 2 года назад

    Hello Gerald, my problem is, I have a base64 json file that I need to output in pdf on screen. I’m sure it is simple but I am going round in circles. Thanks

    • @jfversluis
      @jfversluis  2 года назад

      Not sure how this relates to a CollectionView? 😅 you’ll probably need to convert the base64 to a byte array and save that as a file and then show it

  • @tristanmeijer7080
    @tristanmeijer7080 2 года назад

    Hey Gerald, Thanks for your amazing content first of all. I have a question, In the collection that I pass as ItemSource, I have two strings with the same value. But when I search on an other value in the searchbar and I go back to an empty searchbar. I only see one of the two strings described above with the same value. I hope you can follow me. Thanks in advance!

  • @felixaveras
    @felixaveras 2 года назад

    How to view a products under category? If you have a category named Baberages, the products could be another list with the products in that category like Soda, Juice, Ice Tea an so on....

  • @androidsavior
    @androidsavior 3 года назад

    It is awesome the list got transitions on load, add, remove out of the box !
    I've checked on Android and I've got the same transition for IOS

    • @jfversluis
      @jfversluis  3 года назад

      What transitions are that? Did I miss something? 👀

    • @androidsavior
      @androidsavior 3 года назад

      @@jfversluis I'm saying a good thing actually :)
      No you did not miss anything ♥
      I just meant the fade in/out and slide effect that the collection view does out of the box when an item is added / removed or the entire list is loaded.
      In flutter you need to do so much effort to get these effects.
      I hope it is clear now, And thank you form the heart for the best Xamarin videos ever ♥
      May god bless you ☺♥

    • @jfversluis
      @jfversluis  3 года назад +1

      @@androidsavior Awesome! Thanks!

  • @codigoadictivo
    @codigoadictivo 3 года назад +1

    @gerald, what about a searchbar to search very fast an item in a picker and select it?

    • @jfversluis
      @jfversluis  3 года назад +1

      Interesting case! I guess you could do that :) are your picker options that many?

    • @codigoadictivo
      @codigoadictivo 3 года назад

      @@jfversluis yup, the picker has like 80 name of airports jeje ✌🏽🤣😂

    • @jfversluis
      @jfversluis  3 года назад +1

      @@codigoadictivo Maybe consider a UI redesign? :P

    • @codigoadictivo
      @codigoadictivo 3 года назад

      @@jfversluis uff jeje, picker method seems to work nice jeje, but i was thinking maybe there was a way on combining a searchbar with a picker lol.
      The app is working fine, i just was thinking in a way of helping the pilots to search faster inside the picker jeje, but yeah. Nice vídeos btw 👍🏽

    • @jfversluis
      @jfversluis  3 года назад +1

      Oh sure! I guess you can definitely make it work, but I think you can create the same thing with a better user experience:)
      Thank you!

  • @Onri
    @Onri 3 года назад +1

    Hi Gerald, did you make a video on filtering and mvvm?

    • @jfversluis
      @jfversluis  3 года назад

      Not yet! But I'll put it on the list :D

    • @Onri
      @Onri 3 года назад

      @@jfversluis thanks a lot. Your videos are great to learn from.

    • @jfversluis
      @jfversluis  3 года назад

      @@Onri Thank you Henry, that is great to hear

  • @abdulazizali5259
    @abdulazizali5259 3 года назад

    Hi I tried to use events and gestures inside the collection view with buttons included but it seems not working well ,
    The events are executed twice on other items in the list
    I am stuck really need for help and thanks

    • @jfversluis
      @jfversluis  3 года назад +1

      It’s a bit hard to say anything useful about it without knowing all the details, sorry!

    • @abdulazizali5259
      @abdulazizali5259 3 года назад

      @@jfversluisI found the issue when boxview or frame used inside the template this problem occurs

    • @abdulazizali5259
      @abdulazizali5259 3 года назад

      I solved by setting "IsEnabled" to false for the frame.

    • @jfversluis
      @jfversluis  3 года назад

      Perfect! Glad you figured it out!

  • @RubikMusic
    @RubikMusic 2 года назад

    Hi! I'm having issues filtering because my collection view has grouping, basically I have a List of Lists of Objects. Is there any way to apply this filter to this especific case? Here is the List of Lists:
    public List CATEGORIAS = new List();
    That belongs to this class:
    public class productosCategorias : List
    {
    public string CATEGORIA { get; set; }
    public productosCategorias(string cat, List productos) : base(productos)
    {
    CATEGORIA = cat;
    }
    }
    I hope anyone can help me
    Thanks

    • @jfversluis
      @jfversluis  2 года назад

      You want to make sure that you are searching in the nested collection. The rest should mostly be the same :)

  • @aspsoftwarelab
    @aspsoftwarelab 3 года назад

    Really great video

  • @argonjs
    @argonjs 3 года назад

    Really thanks for the *PRO TIP*

    • @jfversluis
      @jfversluis  3 года назад +1

      While starting with all of this that really got me good a couple of times 😅

  • @blebden
    @blebden 3 года назад

    Hi, I wonder if anyone tried this filtering on list counting thousands of complex items - how fast or slow is it?

    • @jfversluis
      @jfversluis  3 года назад

      If you use the virtualization it should be smooth. If you have that many items you might want to think about doing it server-side though

  • @teymurasadov295
    @teymurasadov295 3 года назад

    Thanks for the advice to filter on 'master source list'! But in this case, canceling the search does not keep the initial order of items

    • @jfversluis
      @jfversluis  3 года назад

      Why not? We iterate over the sourceItems so the items show up in the same order, right? And if you want to influence that you can simply add some order into the mix :)
      Or am I not understanding you correctly?

    • @teymurasadov295
      @teymurasadov295 3 года назад

      @@jfversluis I meant, when you cleared the searchbox on 16:08 the "Subscribed yet?" stayed the second in the list. But of course, I agree, the initial order could be saved if it's required with some additional logic :)

    • @kanstey99
      @kanstey99 Год назад

      ​@@jfversluis : This was an excellent tutorial. However, I actually encountered the same issue with the items not being sorted after the SearchBar is cleared. I thought that I would simply sort at the end of the SearchBar_TextChanged event, but Observable collections do not natively support OrderBy and I was trying to avoid doing heavy manipulation of the underlying collection as it seems to be that it would be inefficient/expensive to do. I looked at the CollectionViewSource class but it is not clear to me whether I could leverage that for this purpose.

  • @deniskaramustafic6924
    @deniskaramustafic6924 3 года назад

    Thank you for you videos, it refreshing.
    Ps just one more thing, set some top margin for title, it gives me ui ocd :D

    • @jfversluis
      @jfversluis  3 года назад

      Hahaha thank you! And I know, right?! I'm twitching every time too... but it's too much overhead to fix it _each_ time :D

  • @spidersoft2771
    @spidersoft2771 3 года назад +1

    Can you make a video how we get device unique identity please

  • @kudzaidube9256
    @kudzaidube9256 3 года назад

    Interesting stuff thanks.... will you be doing an MVVM of this anytime soon? and also may you please send me the discord server link

    • @jfversluis
      @jfversluis  3 года назад

      I can definitely do that! What is the MVVM part that you’re struggling with?
      Here’s the link: discord.gg/hFbKsXqF

    • @kudzaidube9256
      @kudzaidube9256 3 года назад +1

      @@jfversluis Thanks and yes I eventually got the issue sorted

    • @jfversluis
      @jfversluis  3 года назад

      That’s wonderful! Good job!

  • @rikudouensof
    @rikudouensof 2 года назад

    I return here yet again

    • @jfversluis
      @jfversluis  2 года назад +1

      Glad to be of service!

  • @TBTH2H
    @TBTH2H 2 года назад

    Thanks for the video - but I see one disadvantage in that solution: The order of the result list is always changing……

    • @jfversluis
      @jfversluis  2 года назад

      Correct and also noted a couple of times before :) is an easy fix for it though

  • @phamthanhduong74
    @phamthanhduong74 3 года назад

    First, thank you, please help me filter collectionview with Viewmodel

    • @jfversluis
      @jfversluis  3 года назад

      Added to the list, thanks!

  • @petervestifrendrup1307
    @petervestifrendrup1307 3 года назад

    Hey there. Any chance of an invite to the discord :) Great content by the way. Thank you!

    • @jfversluis
      @jfversluis  3 года назад

      Thank you and absolutely! discord.gg/fTFGuHmS

  • @motorparadise
    @motorparadise 3 года назад

    how to combine multiple line same data in one single row in observable collection listview. like in the messenger chat system.
    Example:
    first data/line{
    name: Funny Videos
    id: ID01
    Comment: wow!
    }
    second data/line{
    name: Funny Videos
    id: ID01
    Comment: Awesome!
    }
    I want to show both the output in a single line/row under the same name and ID but with different or last recent comment.
    as:
    one single line/row{
    name: Funny Videos
    id: ID01
    Comment: "wow!, Awesome!" or Just the last comment which is Awesome!
    }
    The data here is inserted at run time dynamically.

    • @jfversluis
      @jfversluis  3 года назад

      I'm very sorry but I don't know what you mean :)

  • @RaabStephan
    @RaabStephan 3 года назад

    I'd love to get an invite to the discord server

    • @jfversluis
      @jfversluis  3 года назад +1

      Ah you watched to the end! Thank you!
      Here you go: discord.gg/djs4jN7n

  • @pabloochoaleon31
    @pabloochoaleon31 Год назад

    Hello Gerald! I did exactly what the tutorial was explaining, but I got a null reference exception, can you invite me to your discord?

  • @richard89k
    @richard89k 2 года назад

    Hey Gerard, could you send me an Discord invite please :)Will try to implement this to my app now :D

    • @jfversluis
      @jfversluis  2 года назад

      Perfect! The link should be under every (more recent) video!

  • @MrBigdogtim69
    @MrBigdogtim69 3 года назад

    Can I get discord invite?

    • @jfversluis
      @jfversluis  3 года назад

      Absolutely! discord.gg/djs4jN7n

    • @michael_azzer
      @michael_azzer 3 года назад

      @@jfversluis What is discord is ?

    • @jfversluis
      @jfversluis  3 года назад +1

      Like Slack :) just a place to chat, hangout and learn and help each other

    • @michael_azzer
      @michael_azzer 3 года назад

      @@jfversluis oh yes than you