Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19245] Windows: Allow mixing Ti.Ui.View and Windows UI components

GitHub Issuen/a
TypeImprovement
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2015-09-28T17:14:04.000+0000
Affected Version/sn/a
Fix Version/sRelease 5.1.0
ComponentsWindows
Labelsn/a
ReporterChristopher Williams
AssigneeChristopher Williams
Created2015-07-22T00:00:20.000+0000
Updated2015-11-17T19:52:32.000+0000

Description

If a developer uses the native wrappers they currently cannot generate native UI components and then add those to a Titanium View/Window, and vice versa. We should support the ability to wrap native UI widgets as Ti.UI.Views when necessary, or unwrap Ti.UI.View native components to native wrappers when necessary. This is something Pedro's ti.reflex handles.

Comments

  1. Christopher Williams 2015-09-14

    I'm seeing crashes on app startup when I mix and match Titanium UI Windows and a TextBlock natively. (win.add(textBlock);) Not sure what the root cause is yet.
  2. Ewan Harris 2015-11-17

    Verified using: OS: Microsoft Windows 10 Pro 10.0.10240 Appc core: 5.1.0-60 Appc NPM: 4.2.1 Ti SDK: 5.1.0.v20151116164430 Appc Studio: 4.4.0.201511130407 Using the below examples works with no issues
       var Window = require('Windows.UI.Xaml.Window'),
           Canvas = require('Windows.UI.Xaml.Controls.Canvas'),
           window = Window.Current,
           canvas = new Canvas(),
           image;
           
       image = Ti.UI.createImageView({
        	image: '/images/testImage.png',
        	height: 50,
        	width: 100
        });
            
           
       canvas.Children.Append(image);
       
       Canvas.SetLeft(image, 100);
       
       window.Content = canvas;
       
       var win,
           TextBlock = require('Windows.UI.Xaml.Controls.TextBlock'),
           text = new TextBlock();
       
       text.Text = "Hello, world!";
       text.FontSize = 60;
       
       win = Ti.UI.createWindow({});
       win.add(text);
       win.open();
       
       var Window = require('Windows.UI.Xaml.Window'),
           Canvas = require('Windows.UI.Xaml.Controls.Canvas'),
           window = Window.Current,
           canvas = new Canvas(),
           text;
       
       text = Ti.UI.createLabel({
           text: "Hello, world!",
           font: {
               fontSize: 60
           }
       });
       canvas.Children.Append(text);
       
       window.Content = canvas;
       window.Activate();
       
    Closing ticket

JSON Source