[TIMOB-19593] Windows: Track native API wrapper conversion objects
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | High |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2016-11-04T06:42:57.000+0000 |
Affected Version/s | Release 5.0.0 |
Fix Version/s | n/a |
Components | Windows |
Labels | n/a |
Reporter | Christopher Williams |
Assignee | Christopher Williams |
Created | 2015-09-28T17:12:50.000+0000 |
Updated | 2017-03-21T20:34:41.000+0000 |
Description
We automatically will wrap/unwrap native UI elements to interact with Ti.UI.View and its subclasses. The issue is that we dynamically unwrap the native Windows.UI.Xaml.UIElement and then wrap it in a special subclass of Ti.UI.View without tracking the two objects. So if we say add a native TextBlock to a Ti.Ui.Window - that will generate a one-time dynamic Ti.Ui.View to wrap the TextBlock. If we make other calls that require converting, we'll generate a _new_ converted Ti.UI.View rather than re-use the previously generated one.
win.add(textblock); // will auto convert the TitaniumWindows::UI::Xaml::TextBlock to a TitaniumWindows::UI::View holding the same underlying Windows::UI::Xaml::TextBlock object.
win.remove(textblock); // This likely won't work. We'll generate _another_ dynamic TitaniumWindows::UI::View object rather than lookup the one we generated above.
// We'd probably have to do:
// win.remove(win.children[win.children.length]);
Resolving this ticket for now because it is obsolete, since we're moving to reflection-based Hyperloop implementation as of TIMOB-23765.