Skip to content

Is there a way to help the diffing work with list boxes? #324

Answered by JaggerJo
marklam asked this question in Q&A
Discussion options

You must be logged in to vote

Use viewItems instead of dataItems. When using dataItems all of Avalonia's binding and template mechanics kick in. This is sometimes what you want when you have large observable lists, ...

                ListBox.create [
                    Grid.row 0
                    ListBox.viewItems [
                        for item in state.Items do
                            Grid.create [
                                Grid.columnDefinitions "Auto,*"
                                Grid.children [
                                    TextBlock.create [
                                        Grid.column 0
                                        TextBlock.text item.Value.Name
                   …

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@marklam
Comment options

@DalekBaldwin
Comment options

@DalekBaldwin
Comment options

Answer selected by marklam
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants