This project is read-only.

Image Control Example

This example explains how to create a simple window with Image control, bind to the data and show on the screen.

See interactive example on http://www.redui.net

UI Model

{
    "windows": [
        {
            "name": "ImageExample",
            "title": "Image Example",
            "left": 500,
            "top": 100,
            "width": 400,
            "height": 300,
            "controls": [
                {
                    "name": "userIcon",
                    "type": "image",
                    "alternateText": "User Icon",
                    "width": 64,
                    "height": 64,
                    "bindsTo": "imageUri"
                },
                {
                    "name": "OKButton",
                    "type": "button",
                    "text": "OK",
                    "isDialogButton": true,
                    "dialogResult": "OK"
                },
                {
                    "name": "CancelButton",
                    "type": "button",
                    "text": "Cancel",
                    "isDialogButton": true,
                    "dialogResult": "Cancel"
                }
            ]
        }
    ]
}

Data Model

var userData = {
	imageUri: "/demo/resources/user-admin.png"
};

Code

var exampleWindow = redui.createNewWindow("ImageExample");
exampleWindow.bind(userData);
exampleWindow.show();


.

Last edited Nov 19, 2013 at 5:16 PM by artemkv, version 1

Comments

No comments yet.