Create WinJS application using ES for JavaScript | Syncfusion Blogs
Live Chat Icon For mobile
Live Chat Icon
Popular Categories.NET  (174).NET Core  (29).NET MAUI  (207)Angular  (109)ASP.NET  (51)ASP.NET Core  (82)ASP.NET MVC  (89)Azure  (41)Black Friday Deal  (1)Blazor  (219)BoldSign  (14)DocIO  (24)Essential JS 2  (107)Essential Studio  (200)File Formats  (66)Flutter  (133)JavaScript  (221)Microsoft  (119)PDF  (81)Python  (1)React  (100)Streamlit  (1)Succinctly series  (131)Syncfusion  (917)TypeScript  (33)Uno Platform  (3)UWP  (4)Vue  (45)Webinar  (51)Windows Forms  (61)WinUI  (68)WPF  (159)Xamarin  (161)XlsIO  (36)Other CategoriesBarcode  (5)BI  (29)Bold BI  (8)Bold Reports  (2)Build conference  (8)Business intelligence  (55)Button  (4)C#  (149)Chart  (131)Cloud  (15)Company  (443)Dashboard  (8)Data Science  (3)Data Validation  (8)DataGrid  (63)Development  (631)Doc  (8)DockingManager  (1)eBook  (99)Enterprise  (22)Entity Framework  (5)Essential Tools  (14)Excel  (40)Extensions  (22)File Manager  (7)Gantt  (18)Gauge  (12)Git  (5)Grid  (31)HTML  (13)Installer  (2)Knockout  (2)Language  (1)LINQPad  (1)Linux  (2)M-Commerce  (1)Metro Studio  (11)Mobile  (507)Mobile MVC  (9)OLAP server  (1)Open source  (1)Orubase  (12)Partners  (21)PDF viewer  (43)Performance  (12)PHP  (2)PivotGrid  (4)Predictive Analytics  (6)Report Server  (3)Reporting  (10)Reporting / Back Office  (11)Rich Text Editor  (12)Road Map  (12)Scheduler  (52)Security  (3)SfDataGrid  (9)Silverlight  (21)Sneak Peek  (31)Solution Services  (4)Spreadsheet  (11)SQL  (11)Stock Chart  (1)Surface  (4)Tablets  (5)Theme  (12)Tips and Tricks  (112)UI  (387)Uncategorized  (68)Unix  (2)User interface  (68)Visual State Manager  (2)Visual Studio  (31)Visual Studio Code  (19)Web  (595)What's new  (332)Windows 8  (19)Windows App  (2)Windows Phone  (15)Windows Phone 7  (9)WinRT  (26)

Create WinJS application using ES for JavaScript

Introduction to WinJS

WinJS is an open source JavaScript library developed by Microsoft. It has been designed with a primary goal of simplifying Windows Store app development for Windows 8, using HTML 5 and JavaScript as an alternative for XAML and C#, VB.NET, or C++ (CX).

Create a simple image viewer application

The following steps will help you understand how to create an application by using WinJS and Essential Studio for JavaScript controls.
Step 1:
Visual Studio 2012 provides a project template to create WinJS applications. Create a blank project from this template as shown in Figure 1. WinJS templates are available in JavaScript > Windows Store.

clip_image002[4]

Figure 1: WinJS project template selection

Step 2:
Add code into the project template created with an HTML page to develop this application. As it is developed by using Syncfusion JavaScript controls, you have to refer to its dependent scripts and style sheets in the <head> section.

   

Note: You can get the above referred scripts and style sheets from the following location:
C:\Users\{User name}\AppData\Local\Syncfusion\EssentialStudio\{version}\JavaScript\assets

Or

[Installed Samples location]\Syncfusion\EssentialStudio\{version}\JavaScript\assets

Step 3:
In the HTML page, add the following code examples to create the application by using Essential Studio for JavaScript:

[CSS]

       .photo {
            background-repeat: no-repeat;
            background-size: 60%;
            background-position: center;
            height: 100%;
            width: 100%;
        }

        .photo1 {
            background-image: url(images/nature.jpg);
        }

        .photo2 {
            background-image: url(images/bird.jpg);
        }

        .photo3 {
            background-image: url(images/snowfall.jpg);
        }

        .photo4 {
            background-image: url(images/sculpture.jpg);
        }

        .photo5 {
            background-image: url(images/seaview.jpg);
        }

 

[HTML]

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Step 4:
Now build and run the application. You can see the image viewer application in Figure 2.

clip_image004[4]

Figure 2: Image viewer application

Sample for Reference

We have attached the image viewer application project for your assistance. You can get it here: ImageViewer

Content Contributor: Thivya K Content Editor: Diljith H

Tags:

Share this post:

Popular Now

Be the first to get updates

Subscribe RSS feed