SlideShare a Scribd company logo
© Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com
SELA DEVELOPER PRACTICE
JUNE 29 – JULY 3, 2014
Michael Haberman
From XAML / C# to HTML5 / JS
How to transition???
Don’t be scared
Lets take our knowledge and experience to HTML JS
Mainly MVVM
The difference
Lots of libraries (AngularJS,Jquery, BackBone, Knockout)
Doesn’t compile
Doesn’t have MVVM Features
Lots of libraries – 20 MVVM Frameworks ?!
The difference
Lots of libraries (AngularJS,Jquery, BackBone, Knockout)
Doesn’t compile
Doesn’t have MVVM Features
Type Script – lets make it compile!
Compiles your Javascript Code!!
Compile time errors
Intellisense
The difference
Lots of libraries (AngularJS,Jquery, BackBone, Knockout)
Doesn’t compile
Doesn’t have MVVM Features
What MVVM Feature do we want?
Data Binding
Converter
Mode
INotifyPropertyChanged
Command
Passing a parameter
Context Binding
Comparison
XAML Knockout
Property changes Implement
INotfiyPropertyChanged
Use KnockoutObservable
Collection changes Implement
INotifyCollectionChanged
Use KnockoutObservableArray
Command Implement ICommand Access any method
Convert data Converter Computed
Binding Inline logic X V
Collection Iterate ItemsControl using DataTemplate Foreach binding using template
Access parent/root ViewModel Relative binding using
RelativeSource
$parent / $root
Access another UI Element ElementBinding $element
Demo
Lets see how to setup the environment
Setting DataContext
Knockout
C#
var vm = new MySampleAPP.MainViewModel()
ko.applyBindings(vm);
DataContext = new MainViewModel();
Binding an element
XAML
<TextBlock Text="{Binding FirstName}"/>
Knockout
<input type="text" data-bind="value: FirstName"/>
Visibility bound to ViewModel
KnockoutXAML
data-bind="if: HasLoggedinUser”
OR
data-bind="visible: Status() == 'Working'"
Visibility="{Binding HasLoggedinUser, Converter={StaticResource Converter}}"/>
Commands
XAMLKnockout
<Button Command="{Binding ChangeUser}"/><input type="button" data-bind="click: ChangeUser, valueUpdate:'input'"/>
Update Options
XAML Knockout
Default Afterkeydown
PropertyChanged Keyup
LostFocus Keypress
Explicit Input
Change
Iterate through collections - XAML
<ItemsControl ItemsSource="{Binding Collection}" >
<TextBlock Text="{Binding Name}"/>
</ItemsControl>
Knockout collections
Like ObservableCollection<T>
public Employees: KnockoutObservableArray<Employee> = ko.observableArray([]);
Iterate thought collections - Knockout
<table data-bind="if: HasLoggedinUser">
<tbody data-bind="foreach: Employees">
<tr>
<td><span data-bind="text: Name"></span></td>
</tr>
</tbody>
</table>
New style converters
Another way to update the UI via ViewModel’s Logic
self.SalaryState = ko.computed(() => {
…
return “red”;
});
<span data-bind="text: Salary, style: { color: SalaryState()}" ></span>
Context binding - Knockout
Within foreach access to ViewModel and passing the current
item as parameter
<input type="button" value="Delete" data-bind="click: $parent.DeleteEmployee" />
Knockout context binding
Similar to relative source or element binding:
$parent - $parent[indexer]
$root
$element
Comparison
XAML Knockout
Property changes Implement
INotfiyPropertyChanged
Use KnockoutObservable
Collection changes Implement
INotifyCollectionChanged
Use KnockoutObservableArray
Command Implement ICommand Access any method
Convert data Converter Computed
Binding Inline logic X V
Collection Iterate ItemsControl using DataTemplate Foreach binding using template
Access parent/root ViewModel Relative binding using
RelativeSource
$parent / $root
Access another UI Element ElementBinding $element
The difference
Lots of libraries (AngularJS,Jquery, BackBone, Knockout)
Doesn’t compile
Doesn’t have MVVM Features
Summary
HTML5 + JS + Knockout isn’t scary!
Knockout provide an easy transition
for XAML developers
Go home and try it your self!
Questions
Ad

More Related Content

What's hot (20)

Wijmo 5 - GrapeCity Echo Tokyo
Wijmo 5 - GrapeCity Echo TokyoWijmo 5 - GrapeCity Echo Tokyo
Wijmo 5 - GrapeCity Echo Tokyo
Chris Bannon
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
Bhagath Gopinath
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
M R Rony
 
Building databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsBuilding databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with Knockoutjs
Nish Anil
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
MaslowB
 
Comparative analysis of java script framework
Comparative analysis of java script frameworkComparative analysis of java script framework
Comparative analysis of java script framework
Nishant Kumar
 
KnockoutJS and MVVM
KnockoutJS and MVVMKnockoutJS and MVVM
KnockoutJS and MVVM
Manvendra Singh
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Sunpawet Somsin
 
Asp.net mvc 4
Asp.net mvc 4Asp.net mvc 4
Asp.net mvc 4
Hrichi Mohamed
 
Canopy view of single-page applications (SPAs)
Canopy view of single-page applications (SPAs)Canopy view of single-page applications (SPAs)
Canopy view of single-page applications (SPAs)
Benjamin Howarth
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax
Brij Mishra
 
Modern Applications With Asp.net Core 5 and Vue JS 3
Modern Applications With Asp.net Core 5 and Vue JS 3Modern Applications With Asp.net Core 5 and Vue JS 3
Modern Applications With Asp.net Core 5 and Vue JS 3
Alexandre Malavasi
 
MVVM & Validation with Kendo UI
MVVM & Validation with Kendo UIMVVM & Validation with Kendo UI
MVVM & Validation with Kendo UI
Lohith Goudagere Nagaraj
 
ASP.NET MVC 3
ASP.NET MVC 3ASP.NET MVC 3
ASP.NET MVC 3
Buu Nguyen
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC Introduction to ASP.NET MVC
Introduction to ASP.NET MVC
Joe Wilson
 
The RAW stack
The RAW stackThe RAW stack
The RAW stack
Maurice De Beijer [MVP]
 
Os mobile
Os mobileOs mobile
Os mobile
jimlindforpope
 
Mvc
MvcMvc
Mvc
abhigad
 
Easy HTML5 Data Visualization with Kendo UI DataViz
Easy HTML5 Data Visualization with Kendo UI DataVizEasy HTML5 Data Visualization with Kendo UI DataViz
Easy HTML5 Data Visualization with Kendo UI DataViz
Lohith Goudagere Nagaraj
 
Os mobile
Os mobileOs mobile
Os mobile
jimlindforpope
 
Wijmo 5 - GrapeCity Echo Tokyo
Wijmo 5 - GrapeCity Echo TokyoWijmo 5 - GrapeCity Echo Tokyo
Wijmo 5 - GrapeCity Echo Tokyo
Chris Bannon
 
Asp.net mvc basic introduction
Asp.net mvc basic introductionAsp.net mvc basic introduction
Asp.net mvc basic introduction
Bhagath Gopinath
 
Single Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJSSingle Page Application (SPA) using AngularJS
Single Page Application (SPA) using AngularJS
M R Rony
 
Building databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with KnockoutjsBuilding databound JavaScript apps with Knockoutjs
Building databound JavaScript apps with Knockoutjs
Nish Anil
 
Mvc presentation
Mvc presentationMvc presentation
Mvc presentation
MaslowB
 
Comparative analysis of java script framework
Comparative analysis of java script frameworkComparative analysis of java script framework
Comparative analysis of java script framework
Nishant Kumar
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Sunpawet Somsin
 
Canopy view of single-page applications (SPAs)
Canopy view of single-page applications (SPAs)Canopy view of single-page applications (SPAs)
Canopy view of single-page applications (SPAs)
Benjamin Howarth
 
ASP.NET MVC and ajax
ASP.NET MVC and ajax ASP.NET MVC and ajax
ASP.NET MVC and ajax
Brij Mishra
 
Modern Applications With Asp.net Core 5 and Vue JS 3
Modern Applications With Asp.net Core 5 and Vue JS 3Modern Applications With Asp.net Core 5 and Vue JS 3
Modern Applications With Asp.net Core 5 and Vue JS 3
Alexandre Malavasi
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVC Introduction to ASP.NET MVC
Introduction to ASP.NET MVC
Joe Wilson
 
Easy HTML5 Data Visualization with Kendo UI DataViz
Easy HTML5 Data Visualization with Kendo UI DataVizEasy HTML5 Data Visualization with Kendo UI DataViz
Easy HTML5 Data Visualization with Kendo UI DataViz
Lohith Goudagere Nagaraj
 

Similar to XAML/C# to HTML5/JS (20)

Knockoutjs
KnockoutjsKnockoutjs
Knockoutjs
Yourcontent YC
 
Viking academy backbone.js
Viking academy  backbone.jsViking academy  backbone.js
Viking academy backbone.js
Bert Wijnants
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.js
Soós Gábor
 
Knockoutjs databinding
Knockoutjs databindingKnockoutjs databinding
Knockoutjs databinding
Boulos Dib
 
Knockout.js
Knockout.jsKnockout.js
Knockout.js
Vivek Rajan
 
Fundaments of Knockout js
Fundaments of Knockout jsFundaments of Knockout js
Fundaments of Knockout js
Flavius-Radu Demian
 
Backbone js in action
Backbone js in actionBackbone js in action
Backbone js in action
Usha Guduri
 
Bringing the light to the client with KnockoutJS
Bringing the light to the client with KnockoutJSBringing the light to the client with KnockoutJS
Bringing the light to the client with KnockoutJS
Boyan Mihaylov
 
MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!
Roberto Messora
 
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShiftReal-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Christian Posta
 
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShiftReal world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Christian Posta
 
Knockoutjs
KnockoutjsKnockoutjs
Knockoutjs
Karthik Sathyanarayanan
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
pootsbook
 
Backbone js
Backbone jsBackbone js
Backbone js
Knoldus Inc.
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
Red Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsRed Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop Labs
Judy Breedlove
 
e-suap - client technologies- english version
e-suap - client technologies- english versione-suap - client technologies- english version
e-suap - client technologies- english version
Sabino Labarile
 
Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)
Natasha Murashev
 
Backbone introdunction
Backbone introdunctionBackbone introdunction
Backbone introdunction
mzxbupt
 
Knockout Basics By Surekha Gadkari
Knockout Basics By Surekha GadkariKnockout Basics By Surekha Gadkari
Knockout Basics By Surekha Gadkari
Surekha Gadkari
 
Viking academy backbone.js
Viking academy  backbone.jsViking academy  backbone.js
Viking academy backbone.js
Bert Wijnants
 
Javascript frameworks: Backbone.js
Javascript frameworks: Backbone.jsJavascript frameworks: Backbone.js
Javascript frameworks: Backbone.js
Soós Gábor
 
Knockoutjs databinding
Knockoutjs databindingKnockoutjs databinding
Knockoutjs databinding
Boulos Dib
 
Backbone js in action
Backbone js in actionBackbone js in action
Backbone js in action
Usha Guduri
 
Bringing the light to the client with KnockoutJS
Bringing the light to the client with KnockoutJSBringing the light to the client with KnockoutJS
Bringing the light to the client with KnockoutJS
Boyan Mihaylov
 
MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!MV* presentation frameworks in Javascript: en garde, pret, allez!
MV* presentation frameworks in Javascript: en garde, pret, allez!
Roberto Messora
 
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShiftReal-world #microservices with Apache Camel, Fabric8, and OpenShift
Real-world #microservices with Apache Camel, Fabric8, and OpenShift
Christian Posta
 
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShiftReal world #microservices with Apache Camel, Fabric8, and OpenShift
Real world #microservices with Apache Camel, Fabric8, and OpenShift
Christian Posta
 
Backbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVCBackbone.js — Introduction to client-side JavaScript MVC
Backbone.js — Introduction to client-side JavaScript MVC
pootsbook
 
WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...WebNet Conference 2012 - Designing complex applications using html5 and knock...
WebNet Conference 2012 - Designing complex applications using html5 and knock...
Fabio Franzini
 
Red Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop LabsRed Hat Agile integration Workshop Labs
Red Hat Agile integration Workshop Labs
Judy Breedlove
 
e-suap - client technologies- english version
e-suap - client technologies- english versione-suap - client technologies- english version
e-suap - client technologies- english version
Sabino Labarile
 
Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)Protocol-Oriented MVVM (extended edition)
Protocol-Oriented MVVM (extended edition)
Natasha Murashev
 
Backbone introdunction
Backbone introdunctionBackbone introdunction
Backbone introdunction
mzxbupt
 
Knockout Basics By Surekha Gadkari
Knockout Basics By Surekha GadkariKnockout Basics By Surekha Gadkari
Knockout Basics By Surekha Gadkari
Surekha Gadkari
 
Ad

More from Michael Haberman (15)

Deploying microservices on AWS
Deploying microservices on AWSDeploying microservices on AWS
Deploying microservices on AWS
Michael Haberman
 
Angular universal
Angular universalAngular universal
Angular universal
Michael Haberman
 
React in production
React in productionReact in production
React in production
Michael Haberman
 
Multiplayer game with angular and firebase
Multiplayer game with angular and firebaseMultiplayer game with angular and firebase
Multiplayer game with angular and firebase
Michael Haberman
 
How to: node js & micro-services
How to: node js & micro-servicesHow to: node js & micro-services
How to: node js & micro-services
Michael Haberman
 
Javascript issues and tools in production for developers
Javascript issues and tools in production for developersJavascript issues and tools in production for developers
Javascript issues and tools in production for developers
Michael Haberman
 
AWS Serverless solution for developers
AWS Serverless solution for developersAWS Serverless solution for developers
AWS Serverless solution for developers
Michael Haberman
 
Angular 4 - quick view
Angular 4 - quick viewAngular 4 - quick view
Angular 4 - quick view
Michael Haberman
 
React vs angular (mobile first battle)
React vs angular (mobile first battle)React vs angular (mobile first battle)
React vs angular (mobile first battle)
Michael Haberman
 
React vs-angular-mobile
React vs-angular-mobileReact vs-angular-mobile
React vs-angular-mobile
Michael Haberman
 
MEAN.js Workshop
MEAN.js WorkshopMEAN.js Workshop
MEAN.js Workshop
Michael Haberman
 
AWS intro
AWS introAWS intro
AWS intro
Michael Haberman
 
Angular Unit Test
Angular Unit TestAngular Unit Test
Angular Unit Test
Michael Haberman
 
Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JS
Michael Haberman
 
XAML/C# to HTML/JS
XAML/C# to HTML/JSXAML/C# to HTML/JS
XAML/C# to HTML/JS
Michael Haberman
 
Deploying microservices on AWS
Deploying microservices on AWSDeploying microservices on AWS
Deploying microservices on AWS
Michael Haberman
 
Multiplayer game with angular and firebase
Multiplayer game with angular and firebaseMultiplayer game with angular and firebase
Multiplayer game with angular and firebase
Michael Haberman
 
How to: node js & micro-services
How to: node js & micro-servicesHow to: node js & micro-services
How to: node js & micro-services
Michael Haberman
 
Javascript issues and tools in production for developers
Javascript issues and tools in production for developersJavascript issues and tools in production for developers
Javascript issues and tools in production for developers
Michael Haberman
 
AWS Serverless solution for developers
AWS Serverless solution for developersAWS Serverless solution for developers
AWS Serverless solution for developers
Michael Haberman
 
React vs angular (mobile first battle)
React vs angular (mobile first battle)React vs angular (mobile first battle)
React vs angular (mobile first battle)
Michael Haberman
 
Unit-testing and E2E testing in JS
Unit-testing and E2E testing in JSUnit-testing and E2E testing in JS
Unit-testing and E2E testing in JS
Michael Haberman
 
Ad

Recently uploaded (20)

Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 
Image processinglab image processing image processing
Image processinglab image processing  image processingImage processinglab image processing  image processing
Image processinglab image processing image processing
RaghadHany
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Automation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From AnywhereAutomation Dreamin': Capture User Feedback From Anywhere
Automation Dreamin': Capture User Feedback From Anywhere
Lynda Kane
 
Asthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdfAsthma presentación en inglés abril 2025 pdf
Asthma presentación en inglés abril 2025 pdf
VanessaRaudez
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In FranceManifest Pre-Seed Update | A Humanoid OEM Deeptech In France
Manifest Pre-Seed Update | A Humanoid OEM Deeptech In France
chb3
 
Salesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docxSalesforce AI Associate 2 of 2 Certification.docx
Salesforce AI Associate 2 of 2 Certification.docx
José Enrique López Rivera
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Rock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning JourneyRock, Paper, Scissors: An Apex Map Learning Journey
Rock, Paper, Scissors: An Apex Map Learning Journey
Lynda Kane
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from AnywhereAutomation Hour 1/28/2022: Capture User Feedback from Anywhere
Automation Hour 1/28/2022: Capture User Feedback from Anywhere
Lynda Kane
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your UsersAutomation Dreamin' 2022: Sharing Some Gratitude with Your Users
Automation Dreamin' 2022: Sharing Some Gratitude with Your Users
Lynda Kane
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
#AdminHour presents: Hour of Code2018 slide deck from 12/6/2018
Lynda Kane
 
Leading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael JidaelLeading AI Innovation As A Product Manager - Michael Jidael
Leading AI Innovation As A Product Manager - Michael Jidael
Michael Jidael
 

XAML/C# to HTML5/JS

  • 1. © Copyright SELA software & Education Labs Ltd. | 14-18 Baruch Hirsch St Bnei Brak, 51202 Israel | www.selagroup.com SELA DEVELOPER PRACTICE JUNE 29 – JULY 3, 2014 Michael Haberman From XAML / C# to HTML5 / JS
  • 2. How to transition??? Don’t be scared Lets take our knowledge and experience to HTML JS Mainly MVVM
  • 3. The difference Lots of libraries (AngularJS,Jquery, BackBone, Knockout) Doesn’t compile Doesn’t have MVVM Features
  • 4. Lots of libraries – 20 MVVM Frameworks ?!
  • 5. The difference Lots of libraries (AngularJS,Jquery, BackBone, Knockout) Doesn’t compile Doesn’t have MVVM Features
  • 6. Type Script – lets make it compile! Compiles your Javascript Code!! Compile time errors Intellisense
  • 7. The difference Lots of libraries (AngularJS,Jquery, BackBone, Knockout) Doesn’t compile Doesn’t have MVVM Features
  • 8. What MVVM Feature do we want? Data Binding Converter Mode INotifyPropertyChanged Command Passing a parameter Context Binding
  • 9. Comparison XAML Knockout Property changes Implement INotfiyPropertyChanged Use KnockoutObservable Collection changes Implement INotifyCollectionChanged Use KnockoutObservableArray Command Implement ICommand Access any method Convert data Converter Computed Binding Inline logic X V Collection Iterate ItemsControl using DataTemplate Foreach binding using template Access parent/root ViewModel Relative binding using RelativeSource $parent / $root Access another UI Element ElementBinding $element
  • 10. Demo Lets see how to setup the environment
  • 11. Setting DataContext Knockout C# var vm = new MySampleAPP.MainViewModel() ko.applyBindings(vm); DataContext = new MainViewModel();
  • 12. Binding an element XAML <TextBlock Text="{Binding FirstName}"/> Knockout <input type="text" data-bind="value: FirstName"/>
  • 13. Visibility bound to ViewModel KnockoutXAML data-bind="if: HasLoggedinUser” OR data-bind="visible: Status() == 'Working'" Visibility="{Binding HasLoggedinUser, Converter={StaticResource Converter}}"/>
  • 14. Commands XAMLKnockout <Button Command="{Binding ChangeUser}"/><input type="button" data-bind="click: ChangeUser, valueUpdate:'input'"/>
  • 15. Update Options XAML Knockout Default Afterkeydown PropertyChanged Keyup LostFocus Keypress Explicit Input Change
  • 16. Iterate through collections - XAML <ItemsControl ItemsSource="{Binding Collection}" > <TextBlock Text="{Binding Name}"/> </ItemsControl>
  • 17. Knockout collections Like ObservableCollection<T> public Employees: KnockoutObservableArray<Employee> = ko.observableArray([]);
  • 18. Iterate thought collections - Knockout <table data-bind="if: HasLoggedinUser"> <tbody data-bind="foreach: Employees"> <tr> <td><span data-bind="text: Name"></span></td> </tr> </tbody> </table>
  • 19. New style converters Another way to update the UI via ViewModel’s Logic self.SalaryState = ko.computed(() => { … return “red”; }); <span data-bind="text: Salary, style: { color: SalaryState()}" ></span>
  • 20. Context binding - Knockout Within foreach access to ViewModel and passing the current item as parameter <input type="button" value="Delete" data-bind="click: $parent.DeleteEmployee" />
  • 21. Knockout context binding Similar to relative source or element binding: $parent - $parent[indexer] $root $element
  • 22. Comparison XAML Knockout Property changes Implement INotfiyPropertyChanged Use KnockoutObservable Collection changes Implement INotifyCollectionChanged Use KnockoutObservableArray Command Implement ICommand Access any method Convert data Converter Computed Binding Inline logic X V Collection Iterate ItemsControl using DataTemplate Foreach binding using template Access parent/root ViewModel Relative binding using RelativeSource $parent / $root Access another UI Element ElementBinding $element
  • 23. The difference Lots of libraries (AngularJS,Jquery, BackBone, Knockout) Doesn’t compile Doesn’t have MVVM Features
  • 24. Summary HTML5 + JS + Knockout isn’t scary! Knockout provide an easy transition for XAML developers Go home and try it your self!