{ "id": "164380", "key": "TIMOB-24100", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2016-11-04T06:22:17.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "hyperloop-windows" ], "versions": [ { "id": "17706", "name": "Release 5.4.0", "archived": false, "released": true, "releaseDate": "2016-08-11" } ], "issuelinks": [], "assignee": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2017-04-29T13:54:18.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "12642", "name": "Windows", "description": "Windows authoring support" } ], "description": "Need ability to dynamically create your own WinRT classes at runtime. Once created, these classes can be used as normal in either Hyperloop or passed to native calls.\r\n\r\nHere's how Hyperloop for iOS does:\r\n{code}\r\nvar MyView = Hyperloop.defineClass('MyClass', 'UIView', ['UIAppearance']);\r\n\r\nMyView.addMethod({\r\n\tselector: 'drawRect:',\r\n\tinstance: true,\r\n\targuments: ['CGRect'],\r\n\tcallback: function (rect) {\r\n\t\t// this code is executed when the drawRect: delegate is called\r\n\t}\r\n});\r\n{code}\r\n\r\nHere's how Hyperloop for Android does:\r\n{code}\r\nvar Activity = require('android.app.Activity'),\r\n activity = new Activity(Ti.Android.currentActivity),\r\n View = require('android.view.View');\r\n \r\nvar MyView = android.view.View.extend({\r\n onDraw: function(canvas) {\r\n // implementation here\r\n }\r\n});\r\n{code}\r\n\r\nFYI: [iOS Hyperloop Programming Guide|http://docs.appcelerator.com/platform/latest/#!/guide/iOS_Hyperloop_Programming_Guide] and [Android Hyperloop Programming Guide|http://docs.appcelerator.com/platform/latest/#!/guide/Android_Hyperloop_Programming_Guide]", "attachment": [], "flagged": false, "summary": "Windows: Ability to define native custom class", "creator": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "kiguchi", "key": "kota", "displayName": "Kota Iguchi", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [], "maxResults": 0, "total": 0, "startAt": 0 } } }