SlideShare a Scribd company logo
KnockoutJS and MVVM
@d_danailov
ASP.NET MVC
Dimitar Danailov
Senior Developer at 158ltd.com
dimityr.danailov[at]gmail.com
Slideshare.net
Github
YouTube
Founder at VarnaIT
Github Code
ASP.NET MVC - Knockoutjs and MVVM
ASP.NET MVC - Knockoutjs and MVVM
ASP.NET MVC - Knockoutjs and MVVM
ASP.NET MVC - Knockoutjs and MVVM
Topics Today
● What is MVVM
● Why use MVVM
● Knockout.js
ASP.NET MVC - Knockoutjs and MVVM
2005
Photo Credit:
http://upload.wikimedia.
org/wikipedia/commons/8/87/MVVMPattern.png
What is MVVM
● Model - View - ModelView
● Model = Data Class
● View = User Interface
● ViewModel (VM)
○ UI binds to this class
○ VM consumes services of Model
○ VM May expose services/properties of Model
What is MVVM
● View knows nothing about Model
● Model knows nothing about View
● Model knows nothing about View Model
● View Model knows nothing about View
● Communication from View to VM is via data binding
○ Lists for List Boxes and Grids
○ IsEnabled properties for Buttons
○ Data for Text Boxes
Why use MVVM
● Separate UI / Business / Data Logic
● Be able to swap out UI
○ Leave business rules/data logic in place
○ ASP.NET to Silverlight
○ WPF to Windows Phone
○ etc.
● Unit testing
● Write less UI code
Photo Credit:
http://s.allacronyms.com/2168932girl.png
ASP.NET MVC - Knockoutjs and MVVM
Rich - client - side interactivity
What is KnockoutJS
MVVM pattern
Web Browser Support
Observable
Core Observable Types
Observable
Core Observable Types
Computed
Observable Array
Observable
Core Observable Types
Computed
Observable Array
Knockout in 3 steps
<input data-bind="value: code" placeholder="code" />
Declarative Binding
Knockout in 3 steps
var myViewModel = {
firstName: ko.observable('John')
}
Create an Observable
Knockout in 3 steps
ko.applyBindings(myViewModel);
Bind the ViewModel
to the View
How knockout's observable
works
Changes to Source
notify targets
How knockout's observable
works
Changes to Source
notify targets
Changes to targets
Notify Source
How knockout's observable
works
Changes to Source
notify targets
Changes to targets
Notify Source
Two - Way Data
Binding
How knockout's observable
works
Changes to Source
notify targets
Changes to targets
Notify Source
Two - Way Data
Binding
Event Binding
ASP.NET MVC - Knockoutjs and MVVM
ASP.NET MVC - Knockoutjs and MVVM
ASP.NET MVC - Knockoutjs and MVVM
MVVM Summary
● MVVM is easy
● Just need an additional class
● Helps to understand the XAML data binding model
● Great for Testing and re-usability
● Don’t worry about being “100% code behind free”
ASP.NET MVC - Knockoutjs and MVVM
ASP.NET MVC - Knockoutjs and MVVM
Questions
Dimitar Danailov
Senior Developer at 158ltd.com
dimityr.danailov[at]gmail.com
Slideshare.net
Github
YouTube
Founder at VarnaIT
Github Code

More Related Content

PDF
Pruebas mostrando pdf's
PDF
ASP.NET - Architecting single page applications with knockout.js
PDF
iOS architecture patterns
PDF
Introduction To MVVM
PPTX
Adopting MVVM
PPTX
Building an enterprise app in silverlight 4 and NHibernate
PPTX
MVVM and Prism
PPT
Windows phone 8 (mvvm)
Pruebas mostrando pdf's
ASP.NET - Architecting single page applications with knockout.js
iOS architecture patterns
Introduction To MVVM
Adopting MVVM
Building an enterprise app in silverlight 4 and NHibernate
MVVM and Prism
Windows phone 8 (mvvm)

Similar to ASP.NET MVC - Knockoutjs and MVVM (20)

PPTX
Design Pattern - MVC, MVP and MVVM
PPTX
WPF For Beginners - Learn in 3 days
PDF
App structure Fundamentals
PDF
Ui design patterns
PPTX
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
PDF
PPTX
Training: MVVM Pattern
PPTX
MVVM ( Model View ViewModel )
PDF
Portable Class Libraries and MVVM
PPTX
реалии использования Mv в i os разработке
PPTX
MVVM presentation
PDF
software architecture
PPTX
Ios models
PPT
Model View ViewModel
PPTX
Fundaments of Knockout js
PPTX
MVVM_Ashraf
PPTX
MVx patterns in iOS (MVC, MVP, MVVM)
PDF
[JogjaJS] Single Page Application nganggo Angular.js
PDF
Principles of MVC for PHP Developers
Design Pattern - MVC, MVP and MVVM
WPF For Beginners - Learn in 3 days
App structure Fundamentals
Ui design patterns
Software architectural design patterns(MVC, MVP, MVVM, VIPER) for iOS
Training: MVVM Pattern
MVVM ( Model View ViewModel )
Portable Class Libraries and MVVM
реалии использования Mv в i os разработке
MVVM presentation
software architecture
Ios models
Model View ViewModel
Fundaments of Knockout js
MVVM_Ashraf
MVx patterns in iOS (MVC, MVP, MVVM)
[JogjaJS] Single Page Application nganggo Angular.js
Principles of MVC for PHP Developers
Ad

More from Dimitar Danailov (20)

PDF
Evolution - ReConnect() 2019
PDF
Data Visualization and D3Js
PDF
#Productivity - {S:01 Ep:03}
PDF
#Productivity - {S:01 Ep:02}
PDF
#Productivity s01 ep02
PDF
#Productivity s01 ep01
PDF
Cloud Conf Varna - Cloud Application with AWS Lambda functions
PDF
DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)
PDF
Building modern Progressive Web Apps with Polymer
PDF
Typescript - MentorMate Academy
PDF
HackConf2016 - Ruby on Rails: Unexpected journey
PDF
Microservices - Code Voyagers Sofia
PDF
Mongo DB Terms - Mentormate Academy
PDF
Startup Europe Week - Cloud Conf Varna & GDG Varna
PDF
GDG Varna - Hadoop
PDF
MicroServices: Advantages ans Disadvantages
PDF
GDG Varna - EcmaScript 6
PDF
Softuni.bg - Microservices
PDF
Cloud Conf Varna: Vagrant and Amazon
PDF
HackConf2015 - Ruby on Rails: Unexpected journey
Evolution - ReConnect() 2019
Data Visualization and D3Js
#Productivity - {S:01 Ep:03}
#Productivity - {S:01 Ep:02}
#Productivity s01 ep02
#Productivity s01 ep01
Cloud Conf Varna - Cloud Application with AWS Lambda functions
DEV.BG - Angular 1 and Jasmine (Unit Testing and TDD)
Building modern Progressive Web Apps with Polymer
Typescript - MentorMate Academy
HackConf2016 - Ruby on Rails: Unexpected journey
Microservices - Code Voyagers Sofia
Mongo DB Terms - Mentormate Academy
Startup Europe Week - Cloud Conf Varna & GDG Varna
GDG Varna - Hadoop
MicroServices: Advantages ans Disadvantages
GDG Varna - EcmaScript 6
Softuni.bg - Microservices
Cloud Conf Varna: Vagrant and Amazon
HackConf2015 - Ruby on Rails: Unexpected journey
Ad

Recently uploaded (20)

PDF
Softaken Excel to vCard Converter Software.pdf
PDF
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
PDF
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
PPTX
Transform Your Business with a Software ERP System
PDF
medical staffing services at VALiNTRY
PPTX
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PPTX
VVF-Customer-Presentation2025-Ver1.9.pptx
PPTX
Operating system designcfffgfgggggggvggggggggg
PPTX
Introduction to Artificial Intelligence
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
PDF
How Creative Agencies Leverage Project Management Software.pdf
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
PDF
top salesforce developer skills in 2025.pdf
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
AI in Product Development-omnex systems
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
PDF
System and Network Administraation Chapter 3
Softaken Excel to vCard Converter Software.pdf
Raksha Bandhan Grocery Pricing Trends in India 2025.pdf
Flood Susceptibility Mapping Using Image-Based 2D-CNN Deep Learnin. Overview ...
Transform Your Business with a Software ERP System
medical staffing services at VALiNTRY
Lecture 3: Operating Systems Introduction to Computer Hardware Systems
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
VVF-Customer-Presentation2025-Ver1.9.pptx
Operating system designcfffgfgggggggvggggggggg
Introduction to Artificial Intelligence
Odoo POS Development Services by CandidRoot Solutions
Claude Code: Everyone is a 10x Developer - A Comprehensive AI-Powered CLI Tool
How Creative Agencies Leverage Project Management Software.pdf
Understanding Forklifts - TECH EHS Solution
Agentic AI : A Practical Guide. Undersating, Implementing and Scaling Autono...
top salesforce developer skills in 2025.pdf
Design an Analysis of Algorithms I-SECS-1021-03
AI in Product Development-omnex systems
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
System and Network Administraation Chapter 3

ASP.NET MVC - Knockoutjs and MVVM