{"id":7117,"date":"2013-03-14T16:24:18","date_gmt":"2013-03-14T21:24:18","guid":{"rendered":"http:\/\/mjtsai.com\/blog\/?p=7117"},"modified":"2013-03-14T16:24:18","modified_gmt":"2013-03-14T21:24:18","slug":"mvvm-and-view-models","status":"publish","type":"post","link":"https:\/\/mjtsai.com\/blog\/2013\/03\/14\/mvvm-and-view-models\/","title":{"rendered":"MVVM and View Models"},"content":{"rendered":"<p><a href=\"http:\/\/cocoasamurai.blogspot.com\/2013\/03\/basic-mvvm-with-reactivecocoa.html\">Colin Wheeler<\/a>:<\/p>\n<blockquote cite=\"http:\/\/cocoasamurai.blogspot.com\/2013\/03\/basic-mvvm-with-reactivecocoa.html\"><p>In the MVVM pattern the View Model encapsulates data\/properties that the view can bind to, any validation logic and actions that can be performed. For instance if you had a button that needs to change its title text you would have a property on the view model that the button can bind its title property to. The same goes if you need to change the color of a control or enable and disable the control. In this pattern we are essentially taking the state of our app and putting it into a view model.<\/p><\/blockquote>\n<p>Among other benefits, this decoupling makes it easier to test and revise the interface.<\/p>","protected":false},"excerpt":{"rendered":"<p>Colin Wheeler: In the MVVM pattern the View Model encapsulates data\/properties that the view can bind to, any validation logic and actions that can be performed. For instance if you had a button that needs to change its title text you would have a property on the view model that the button can bind its [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"apple_news_api_created_at":"","apple_news_api_id":"","apple_news_api_modified_at":"","apple_news_api_revision":"","apple_news_api_share_url":"","apple_news_coverimage":0,"apple_news_coverimage_caption":"","apple_news_is_hidden":false,"apple_news_is_paid":false,"apple_news_is_preview":false,"apple_news_is_sponsored":false,"apple_news_maturity_rating":"","apple_news_metadata":"\"\"","apple_news_pullquote":"","apple_news_pullquote_position":"","apple_news_slug":"","apple_news_sections":"\"\"","apple_news_suppress_video_url":false,"apple_news_use_image_component":false,"footnotes":""},"categories":[4],"tags":[69,374,373,71,341],"class_list":["post-7117","post","type-post","status-publish","format-standard","hentry","category-programming-category","tag-cocoa","tag-mvc","tag-mvvm","tag-programming","tag-reactivecocoa"],"apple_news_notices":[],"_links":{"self":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/comments?post=7117"}],"version-history":[{"count":1,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7117\/revisions"}],"predecessor-version":[{"id":7118,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/posts\/7117\/revisions\/7118"}],"wp:attachment":[{"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/media?parent=7117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/categories?post=7117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mjtsai.com\/blog\/wp-json\/wp\/v2\/tags?post=7117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}