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

Using ListViews with itemsSource #19

Open
paulvarache opened this issue Jul 17, 2024 · 0 comments
Open

Using ListViews with itemsSource #19

paulvarache opened this issue Jul 17, 2024 · 0 comments

Comments

@paulvarache
Copy link

Hi,

I've been successfully using this repo to work on a windows app using swift. I am trying to use the ListView with its itemsSource property. Looking at the WinRT API reference the itemsSource should implement IObservableVector, I found bindings for ItemCollection which implements it, but can't find a way to provide the data for it.

Looking at the toVector extension provided I tried implementing a toObservableVector but the swift toolchain crashes while trying to build:

SIL verification failed: public/package/shared function must have a body: F->isDefinition() || F->hasForeignBody()
In function:
// IVector.subscript.read
sil shared [serialized] @$s17WindowsFoundation7IVectorPAAEy7ElementQzSicir : $@yield_once @convention(method) <τ_0_0 where τ_0_0 : IVector> (Int, @guaranteed τ_0_0) -> @yields @in_guaranteed τ_0_0.Element

I actually get the same result if I just copy over the contents of the ARRAY+TOVECTOR file, which makes me think those types of Support file need to be compiled with different settings than source files for an app.

I'm not too versed in either swift or WinRT bindings for swift so I'm making a lot of assumptions here.

I assume the BCNY team found a solution to use ListViews (or any ItemsControl) with itemsSource. Unless you don't use the virtualisation and provide items directly?

Thanks again for creating such a project and opening it up to the world!

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

No branches or pull requests

1 participant