View Issue Details

IDProjectCategoryView StatusLast Update
0001536NoesisGUIC++ SDKpublic2019-08-22 01:29
ReporterstevehAssigned Tojsantos 
Status assignedResolutionopen 
Product Version2.2.1 
Target VersionFixed in Version 
Summary0001536: Can't bind to array index element - "Array properties can't be boxed"
DescriptionHi guys, trying to bind to a fixed array declared in a data model. This works fine in Blend but I hit an assert in the C++ API here:

template<class T, uint32_t N>
Ptr<BaseComponent> TypePropertyArray<T,N>::GetComponent(const void*) const
    // Array properties can't be boxed

This is my data model

// C#
class Baz
    public Baz() : i(0) {}
    public int i { get; set;}
class Foo
    public Foo() { Bar = new Baz[2]; }
    public Baz Bar[];

// WPF
<TextBlock Text="{Binding Bar[0].i}" >

// C++ .h
class Baz : BaseComponent
    int i = 0;
    NS_DECLARE_REFLECTION(Baz, BaseComponent)
class Foo : BaseComponent
    Ptr<Baz> Bar[2];
    NS_DECLARE_REFLECTION(Foo, BaseComponent)

// C++ .cpp
Foo::Foo() {
    Bar[0] = MakePtr<Baz>();
    Bar[1] = MakePtr<Baz>();

    NsProp("i", &SelfClass::i);

    NsProp("Bar", &SelfClass::Bar);
Steps To Reproduce1. Have a fixed array of objects derived from BaseComponent in a data model.
2. Try to bind to an index on a component.
3. Try to instance the component, see the assert fire.
TagsNo tags attached.




2019-08-22 01:29

manager   ~0005935

Right now this is not possible, you need to use an ObservableCollection. Yeah, I know it is far from optimal and not as efficient as a static array.
This scenario and more things are going to be improved in the next reflection architecture we are working on.

Issue History

Date Modified Username Field Change
2019-08-13 18:45 steveh New Issue
2019-08-22 01:28 jsantos Assigned To => jsantos
2019-08-22 01:28 jsantos Status new => assigned
2019-08-22 01:29 jsantos Note Added: 0005935