GithubHelp home page GithubHelp logo

Comments (14)

Eilon avatar Eilon commented on May 23, 2024 2

@0x414c49 we're looking for any kind of valuable contributions! For the wrappers, I'm working on a tool to help automate this: #25

The tool won't be perfect, because several Xamarin.Forms UI controls have some special requirements, but the tool will help get a lot further a lot faster.

from mobileblazorbindings.

smartprogrammer93 avatar smartprogrammer93 commented on May 23, 2024 1

Hello @Eilon ,
thank you for your work on this amazing project. Do you think there would be a way that automates wrapping elements as there are thousands of components in the xamarin environment other than the basic ones mentioned in this issue.

from mobileblazorbindings.

Eilon avatar Eilon commented on May 23, 2024

This has come up before so I logged a suggestion here to track it: #25 . Let's continue the discussion there on thoughts for how to automate it (it's not easy to get 100%).

from mobileblazorbindings.

0x414c49 avatar 0x414c49 commented on May 23, 2024

@Eilon I learned how to create new wrappers and adding XF properties to elements. Since you are keeping the project updated. Can't we create issues an assigned to ourselves to do it?

I know at the moment, you are looking for feedbacks maybe not contributions, but people like me can help to make the procedure faster.

from mobileblazorbindings.

Pheros avatar Pheros commented on May 23, 2024

Is it possible to create a list of selectable items. No?

from mobileblazorbindings.

Eilon avatar Eilon commented on May 23, 2024

@Pheros are you asking if there is a component that enables building a UI for multiple selection?

from mobileblazorbindings.

Pheros avatar Pheros commented on May 23, 2024

Yes. I want to create a list of selectable items, define a couple of sliders, where the user could choose a number between 1 and 5 and then store those numbers to a database.

from mobileblazorbindings.

Eilon avatar Eilon commented on May 23, 2024

Hi @Pheros I'm not aware of any built-in component that does this. A common way to do something similar is to have a list and have a <Switch> component for each row, and then you can select all the items that have the switch toggled.

If you have further questions about this, please log a new issue so that we can keep each issue focused on a single topic. Thanx!

from mobileblazorbindings.

freever avatar freever commented on May 23, 2024

Hi @Eilon

I see CollectionView is on your list... how high is it on your list of priorities?

Performant lists are essential for most mobile applications and CollectionView is the recommended approach these days in XF.

I see you have used a StackLayout in a ScrollView in some of the samples - I guess this maps most easily to the HTML list concept and the data loading pattern in Blazor. But I wonder will this scale to large lists of items or even infinite scrolling lists?

I have also been wondering how the usual XF pattern of having an ObservableCollection of items databound as the ItemsSource of a layout would translate to the web paradigm that Blazor comes from?

For example, in the Xaminals sample, lists are populated like so:

 <ScrollView>
        <StackLayout>
            @foreach (var animal in MobileBlazorBindingsXaminals.Data.MonkeyData.Monkeys)
            {
                <AnimalTemplate Animal="animal" />
            }
        </StackLayout>
    </ScrollView>

and Monkeys is an IList. Now if Monkeys were an ObservableCollection, and I added a Monkey, what would happen? Would all the list items be recreated, or none of them, or only the new one?

I totally love the Blazor approach and I really hope it can become a first class way of building XF apps.

from mobileblazorbindings.

Eilon avatar Eilon commented on May 23, 2024

Hi @freever thank you for the question. CollectionView is high on my list in terms of interest, but also high on my list in terms of complexity, so unfortunately this means it's not clear when it will happen. It is complex because it uses Xamarin.Form's templates, which I've had a difficult time trying to map to the Blazor world. I've made a few attempts but kept getting stuck.

As to the other parts of your question:

Blazor binding can be very efficient. If you have a list with 10 items in it and then add an 11th item, only the new controls needed for the new 11th item will be created. All the first 10 controls will be untouched. Currently in Mobile Blazor Bindings there are some more advanced internals that are not yet implemented that make it more efficient when you insert into the middle of a list. It'll work fine as things are, but not at maximum efficiency. As to ObservableCollection, there is generally no need for that in the Blazor world because Blazor works based on diffing, not reactive observations.

And for infinite scrolling, there are some neat approaches people have used with Blazor for the Web ("regular Blazor") that I'm hoping I can map to the world of Mobile Blazor Bindings. Haven't looked too deeply into it yet though.

from mobileblazorbindings.

freever avatar freever commented on May 23, 2024

That is really interesting. I did some hasty reading up on Blazor collections and apparently if you apply the @key attribute to each <tr> that contains a component and map it to the backing model then Blazor will compare the existing <tr> with the new <tr> generated on state changes and only apply changes if there is a diff. That resolves a question I had about how Blazor knows whether to change, remove or add an item in a collection without re-rendering the whole thing each time.

It's an interesting challenge, applying Blazor to mobile, because the paradigms are so different. If you take away the INotifyPropertyChanged MVVM paradigm (which Blazor does) then Xamarin Forms becomes a completely different animal - probably a much easier one to code and reason about, and possibly more performant too.

Anyway, thanks for your response and well done on the work so far, I really like it!

from mobileblazorbindings.

Eilon avatar Eilon commented on May 23, 2024

Yup, in Blazor @key is the trick to high-performing collection updates, but I don't think it works in Mobile Blazor Bindings yet. (Maybe it does work, but I haven't tried, and I think I left out the part that would make it work.)

Indeed, the INotifyXyz and MVVM patterns are a negative for some people - particularly those who like Blazor's patterns. That's why we have this project!

from mobileblazorbindings.

aktxyz avatar aktxyz commented on May 23, 2024

+1 for carousel and collectionview

from mobileblazorbindings.

MvandeRuitenbeek avatar MvandeRuitenbeek commented on May 23, 2024

I think this project is awesome!! Did a lot with normal blazor, now this was exactly what I was looking for to do mobile development

from mobileblazorbindings.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.