How to register attached property of complex type?
Hi, I'm trying to register a property of type Noesis::TreeViewItem* in my TreeView-derived custom control, but I can't for the life of me figure out why this doesn't work:
It builds, but I get the runtime error left of '.GetHashCode' must have class/struct/union.
The examples in the documentation are only for floats, and in general, it'd be nice to see better examples beyond the most basic use case.
I'm running Noesis 2.2 C++ SDK, if that's any help.
Code: Select all
data->RegisterProperty<TreeViewItem*>(SelectedItemsStartProperty, "SelectedItemsStart", FrameworkPropertyMetadata::Create<TreeViewItem*>(nullptr));
The examples in the documentation are only for floats, and in general, it'd be nice to see better examples beyond the most basic use case.
I'm running Noesis 2.2 C++ SDK, if that's any help.
-
sfernandez
Site Admin
- Posts: 2991
- Joined:
Re: How to register attached property of complex type?
For ref counted objects (inheriting from BaseComponent) we are storing the dependency property using a Ptr and the definition should look like this:
Code: Select all
data->RegisterProperty<Ptr<TreeViewItem>>(SelectedItemsStartProperty, "SelectedItemsStart",
FrameworkPropertyMetadata::Create<Ptr<TreeViewItem>>(nullptr));
Re: How to register attached property of complex type?
Thank you so much!
I swear I tried it before but I must've gotten something wrong. :)
I swear I tried it before but I must've gotten something wrong. :)
Who is online
Users browsing this forum: Ahrefs [Bot], Bing [Bot], Google [Bot] and 41 guests