Skip to content

C++/WinRT single_threaded_observable_vector now supports IInspectable automatically#449

Merged
kennykerr merged 18 commits into
masterfrom
kennykerr-first
May 30, 2019
Merged

C++/WinRT single_threaded_observable_vector now supports IInspectable automatically#449
kennykerr merged 18 commits into
masterfrom
kennykerr-first

Conversation

@kennykerr

@kennykerr kennykerr commented May 30, 2019

Copy link
Copy Markdown
Contributor

The single_threaded_observable_vector<T>() helper function creates an implementation of IObservableVector<T> and if T is not IInspectable then the resulting object will now also implement IObservableVector<IInspectable>. Observable collections are predominantly used for Xaml binding and the Xaml framework requires IObservableVector<IInspectable> in order to support binding.

And every time I work on collections I always end up with way more test code than shipping code...

I have also confirmed that this works beautifully with Xaml binding.

@BenJKuhn BenJKuhn left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice work with deferred boxing. Any concerns around expected behavior of boxed element identity?

@kennykerr

Copy link
Copy Markdown
Contributor Author

Thanks! I don't think there's a concern since Xaml already does copious amounts of boxing/unboxing and the underlying boxing mechanics continues to rely on the implementation provided by Windows::Foundation::PropertyValue.

@kennykerr kennykerr merged commit e8d4b6d into master May 30, 2019
@kennykerr kennykerr deleted the kennykerr-first branch May 30, 2019 19:15
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.

2 participants