Repository navigation
TestComponent: add composable classes with collection and IClosable - #6
Merged
Merged
Conversation
ComposableVector, ComposableMap and ComposableClosable are unsealed classes that implement IVector<Int32>, IMap<String, Int32> and IClosable, as XAML's ResourceDictionary, DependencyObjectCollection and DesktopWindowXamlSource do. ComposableClosable records whether Close() was called. This allows testing that a projection gives a class derived from a composable class the collection and IClosable protocols of the class it derives from, without XAML.
dlech
force-pushed
the
composable-protocols
branch
from
November 29, 2026 03:45
a1da931 to
c4e7910
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three unsealed classes with default constructors to TestComponent:
ComposableVectorimplementsIVector<Int32>(and soIIterable<Int32>), backed by astd::vector<int32_t>.ComposableMapimplementsIMap<String, Int32>, backed by astd::map<hstring, int32_t>.ComposableClosableimplementsIClosableand has a read-onlyIsClosedproperty that tells whetherClose()was called.These are the shapes of XAML's
ResourceDictionary,DependencyObjectCollectionandDesktopWindowXamlSource, which a projection can't test without XAML. pywinrt needs them to test that a Python subclass of a composable class gets the collection andIClosableprotocols of the class it derives from.Nothing that already exists changes.
GetView()returns a snapshot, since C++/WinRT'svector_baseandmap_basereturn the class itself as the view, which works only for a class that also implementsIVectorView/IMapView.Checked by building Release x64, x86 and ARM64 and
nuget pack, and with a throwaway C++/WinRT console test that used each class directly and composed a C++ subclass overComposableVectorandComposableClosable.