My Struct() Custom Data Type that Binds
I’ve wanted to have a struct (hashtable) class that I can use for some time that also bind to controls like List, DataGrid, etc… Dictionary works fine, it just didn’t update the bindings. I just hadn’t figured out how to make sure how to make sure it’s dispatching events. But I finally got around to creating a class that behaves more like a cold fusion struct that I can bind to. You can’t bind to it using brackets, but you can read values by key and set values by key. To bind by key there’s a method you have to go through. You can get the class here
Here’s a brief run down of use cases:
Create a new Struct
[
Bindable] public var struct : Struct = new Struct();Set a value
struct[key] = value or struct.addByKey(key,value);
Read a value
struct[key] or struct.getByKey(key);
Bind to a value by key
{ struct.getByKey(key) }
Recent Comments