Skip to content
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

Preview 8 #304

Merged
merged 7 commits into from
May 19, 2023
Merged

Preview 8 #304

merged 7 commits into from
May 19, 2023

Conversation

JaggerJo
Copy link
Member

No description provided.

Numpsy and others added 5 commits May 12, 2023 16:41
* Start updating to Avalona 11 preview 7

* Try to get the diagnostics lib building

* Remove [Obsolete] from ViewBuilder.Create

---------

Co-authored-by: Richard Webb <richard.webb@helpsystems.com>
@JaggerJo JaggerJo changed the title [WIP] Preview 8 Preview 8 May 12, 2023
@JaggerJo
Copy link
Member Author

@Numpsy everything builds now 🎉

@Numpsy
Copy link
Collaborator

Numpsy commented May 12, 2023

I wasn't clear about what the ItemsControl itmes changed event should be bound to, as I thought I'd read that it can be used with an items collection without setting ItemsSource to a value, but i'm not entirely clear on the relationship between the two :-(

On a positive note, the menu flyout example in the control catalog app was showing an empty dropdown with the preview 6 build, and that looks to have been fixed in the update

@JaggerJo
Copy link
Member Author

I wasn't clear about what the ItemsControl itmes changed event should be bound to, as I thought I'd read that it can be used with an items collection without setting ItemsSource to a value, but i'm not entirely clear on the relationship between the two :-(

This fires every time the button is clicked, but as you say it does not work if viewItems is used instead of dataItems.

Component (fun ctx ->
    let toggle = ctx.useState false
    let items = ctx.useState<IEnumerable> [ 0 .. 10 ]
    DockPanel.create [
        DockPanel.children [
            Button.create [
                Button.dock Dock.Bottom
                Button.onClick (fun _ ->
                    if toggle.Current then
                        items.Set [ 0 .. 10 ]
                    else
                        items.Set [ 'A' .. 'C' ]
                    toggle.Set (not toggle.Current)
                )
                Button.content "change items"
                Button.horizontalAlignment HorizontalAlignment.Stretch
            ]
            ItemsControl.create [
                ItemsControl.onItemsChanged (fun _ -> printfn "Items changed!")
                ItemsControl.dataItems items.Current
            ]
        ]
    ]
)

On a positive note, the menu flyout example in the control catalog app was showing an empty dropdown with the preview 6 build, and that looks to have been fixed in the update

Nice!

@JaggerJo JaggerJo merged commit 57d4eb2 into master May 19, 2023
1 check passed
@JaggerJo JaggerJo deleted the preview-8 branch May 19, 2023 14:06
@AngelMunoz AngelMunoz mentioned this pull request May 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants