{"id":208326,"date":"2014-01-07T14:19:03","date_gmt":"2014-01-07T10:19:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=208326"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=208326","title":{"rendered":"<span class=\"post_title\">MVVM: \u043d\u043e\u0432\u044b\u0439 \u0432\u0437\u0433\u043b\u044f\u0434<\/span>"},"content":{"rendered":"<div class=\"content html_format\"> \t\t\t<b>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/b><\/p>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u044f \u0437\u0430\u0442\u0435\u044f\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0441 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 WPF. \u0414\u043e\u0432\u0435\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430\u043a\u043e\u043f\u0438\u043b\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043e\u043f\u044b\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043b\u044e\u0434\u044c\u043c\u0438.<\/p>\n<p>  <b>\u041a \u0434\u0435\u043b\u0443<\/b><\/p>\n<p>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c WPF, Silverlight \u0438 WinPhone-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f MVVM (Model \u2014 View \u2014 ViewModel). \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u0435\u0449\u0451 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438, \u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0430\u0436\u0435, \u043e\u0441\u043c\u0435\u043b\u044e\u0441\u044c \u0437\u0430\u0432\u0435\u0440\u0438\u0442\u044c, \u0440\u0435\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u043e\u0435. <a name=\"habracut\"><\/a><\/p>\n<p>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043b\u0430\u0441\u0441\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043e\u043a\u043d\u043e (View) \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0441 \u043c\u0435\u043d\u044e, \u0442\u0443\u043b\u0431\u0430\u0440 \u0442\u0440\u0435\u0435\u043c \u0438 \u0441\u0442\u0430\u0442\u0443\u0441 \u0431\u0430\u0440\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043f\u0440\u044f\u0442\u0430\u0442\u044c \u043f\u0440\u0438 \u0436\u0435\u043b\u0430\u043d\u0438\u0438. \u041f\u0435\u0440\u0435\u0434 \u043d\u0430\u043c\u0438 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u0434\u0430\u0447\u0430 \u2013 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0438 \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u043e\u043a\u043d\u0430, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u0442\u043e\u043c \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0438\u0445. <\/p>\n<p>  \u041e\u0431\u044b\u0447\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0443\u043c, \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0432\u043e \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u044c \u0440\u044f\u0434\u0430 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0434\u043b\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 (Top, Left, Width, Heigth, ShowToolBarTray, ShowStatusBar \u0438 \u0434\u0440\u0443\u0433\u0438\u0445), \u0430 \u0437\u0430\u0442\u0435\u043c \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u0444\u0430\u0439\u043b. \u041d\u043e \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u0441\u043f\u0435\u0448\u0438\u0442\u044c\u2026 \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u044f \u0432\u0430\u043c \u0441\u043a\u0430\u0436\u0443, \u0447\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0442\u0430\u043a\u0443\u044e \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u044b\u0432\u0430\u0442\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u041d\u0418 \u041e\u0414\u041d\u041e\u0419 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430?<\/p>\n<p>  <b>\u0421\u0440\u0430\u0437\u0443 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0441\u043a\u0430\u0447\u0430\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 (\u0441\u0441\u044b\u043b\u043a\u0430 <a href=\"http:\/\/yadi.sk\/d\/_iq--fSVFThbk\">\u043e\u0434\u0438\u043d<\/a> \u0438\u043b\u0438 <a href=\"http:\/\/poet.of.by\/downloads\/MuseMVVM.zip\">\u0434\u0432\u0430<\/a>)<\/b>, \u043e\u043d \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043d\u044f\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0434\u0435\u0438 \u0438 \u043f\u0440\u043e\u0447\u0443\u0432\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043a\u0440\u0430\u0441\u043e\u0442\u0443 \u043f\u043e\u0434\u0445\u043e\u0434\u0430. \u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u044f \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0435 \u0447\u0430\u0441\u0442\u0438 \u043a\u043e\u0434\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u043e\u0441\u043e\u0431\u043e\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<p>  \u0412 WPF \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0430 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c, \u043d\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0430\u043a\u0436\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0440\u0435\u0434\u043a\u043e. \u041d\u043e \u0432\u043e\u0442 \u043e\u043d\u0430-\u0442\u043e \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u043d\u0430\u043c \u043d\u043e\u0432\u044b\u0435 \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u044b. \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u044c, \u043a\u0430\u043a \u0441\u043b\u043e\u0432\u0430\u0440\u044c, \u0433\u0434\u0435 \u043a\u043b\u044e\u0447\u043e\u043c-\u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u041d\u043e \u043a\u0430\u043a \u0436\u0435 \u043d\u0430\u043c \u043b\u0443\u0447\u0448\u0435 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f? \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u0438! \u041d\u043e?.. \u042d\u0442\u043e \u0432\u0435\u0434\u044c \u043d\u0435 DTO-\u043e\u0431\u044a\u0435\u043a\u0442, \u0434\u0430 \u0438 \u043a\u0430\u043a \u043f\u043e\u0442\u043e\u043c \u0438\u0445 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u0432\u0435\u0434\u044c \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0447\u0430\u0441\u0442\u043e \u043d\u0443\u0436\u043d\u043e \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0440\u0443\u0433\u0438\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b, \u0430 \u0434\u043b\u044f \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u0431\u044b\u0447\u043d\u043e \u043d\u0443\u0436\u0435\u043d \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0431\u0435\u0437 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432? \u0410 \u0432\u0430\u043c \u043d\u0438\u043a\u043e\u0434\u0430 \u043d\u0435 \u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0438\u043d\u0436\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0435\u0443\u0434\u043e\u0431\u043d\u044b\u043c, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0438\u043b\u0438 \u0443\u0434\u0430\u043b\u0435\u043d\u0438\u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430 \u043b\u043e\u043c\u0430\u043b\u0438\u0441\u044c \u044e\u043d\u0438\u0442 \u0442\u0435\u0441\u0442\u044b, \u0438 \u0438\u0445 \u0442\u043e\u0436\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u043f\u0440\u0430\u0432\u0438\u0442\u044c, \u0445\u043e\u0442\u044f \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430, \u043f\u043e \u0441\u0443\u0442\u0438, \u043e\u0441\u0442\u0430\u0432\u0430\u043b\u0441\u044f \u043f\u0440\u0435\u0436\u043d\u0438\u043c?<\/p>\n<p>  \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0442\u043a\u0430\u0436\u0435\u043c\u0441\u044f \u043e\u0442 \u0438\u043d\u0436\u0435\u043a\u0446\u0438\u0439 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440, \u0431\u043b\u0430\u0433\u043e, \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0434\u043b\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0446\u0435\u043b\u0435\u0439, \u0438 \u043f\u043e\u043c\u0435\u0442\u0438\u043c \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c [DataContract], \u0430 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u043e \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c, \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c [DataMember] (\u044d\u0442\u0438 \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043e\u0447\u0435\u043d\u044c \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e).<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043a\u043b\u0430\u0441\u0441 Store.<\/p>\n<pre><code class=\"cs\">    public static class Store     {         private static readonly Dictionary&lt;Type, object&gt; StoredItemsDictionary = new Dictionary&lt;Type, object&gt;();          public static TItem OfType&lt;TItem&gt;(params object[] args) where TItem : class         {             var itemType = typeof (TItem);             if (StoredItemsDictionary.ContainsKey(itemType))                 return (TItem) StoredItemsDictionary[itemType];              var hasDataContract = Attribute.IsDefined(itemType, typeof (DataContractAttribute));             var item = hasDataContract                 ? Serializer.DeserializeDataContract&lt;TItem&gt;() ?? (TItem) Activator.CreateInstance(itemType, args)                 : (TItem) Activator.CreateInstance(itemType, args);              StoredItemsDictionary.Add(itemType, item);             return (TItem) StoredItemsDictionary[itemType];         }          public static void Snapshot()         {             StoredItemsDictionary                 .Where(p =&gt; Attribute.IsDefined(p.Key, typeof (DataContractAttribute)))                 .Select(p =&gt; p.Value).ToList()                 .ForEach(i =&gt; i.SerializeDataContract());         }     } <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0451 \u043f\u0440\u043e\u0441\u0442\u043e \u2013 \u043b\u0438\u0448\u044c \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430. OfType \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0449\u0430\u0435\u0442 \u043d\u0430\u043c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u044d\u043a\u0437\u0435\u043c\u043f\u043b\u044f\u0440 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u043e\u0433\u043e \u0442\u0438\u043f\u0430, \u043f\u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0442\u0438 \u0434\u0435\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u044f \u0435\u0433\u043e, \u0438 Snapshot \u0434\u0435\u043b\u0430\u0435\u0442 \u00ab\u0441\u043d\u0438\u043c\u043e\u043a\u00bb \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u043d\u0430\u0445\u043e\u0434\u044f\u0449\u0438\u0445\u0441\u044f \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435, \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0443\u044f \u0438\u0445. \u0412\u044b\u0437\u043e\u0432 Snapshot \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043c\u043e\u0436\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0438\u0442\u044c \u043b\u0438\u0448\u044c \u043e\u0434\u0438\u043d \u0440\u0430\u0437 \u043f\u0440\u0438 \u0437\u0430\u043a\u0440\u044b\u0442\u0438\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0435 Exit \u043a\u043b\u0430\u0441\u0441\u0430 Application.<\/p>\n<p>  \u0418 \u043d\u0430\u043f\u0438\u0448\u0435\u043c Json-\u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440.<\/p>\n<pre><code class=\"cs\">    public static class Serializer     {         public const string JsonExtension = &quot;.json&quot;;          public static readonly List&lt;Type&gt; KnownTypes = new List&lt;Type&gt;         {             typeof (Type),             typeof (Dictionary&lt;string, string&gt;),             typeof (SolidColorBrush),             typeof (MatrixTransform),         };          public static void SerializeDataContract(this object item, string file = null, Type type = null)         {             try             {                 type = type ?? item.GetType();                 if (string.IsNullOrEmpty(file))                     file = type.Name + JsonExtension;                 var serializer = new DataContractJsonSerializer(type, KnownTypes);                 using (var stream = File.Create(file))                 {                     var currentCulture = Thread.CurrentThread.CurrentCulture;                     Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;                     serializer.WriteObject(stream, item);                     Thread.CurrentThread.CurrentCulture = currentCulture;                 }             }             catch (Exception exception)             {                 Trace.WriteLine(&quot;Can not serialize json data contract&quot;);                 Trace.WriteLine(exception.StackTrace);             }         }          public static TItem DeserializeDataContract&lt;TItem&gt;(string file = null)         {             try             {                 if (string.IsNullOrEmpty(file))                      file = typeof (TItem).Name + JsonExtension;                 var serializer = new DataContractJsonSerializer(typeof (TItem), KnownTypes);                 using (var stream = File.OpenRead(file))                 {                     var currentCulture = Thread.CurrentThread.CurrentCulture;                     Thread.CurrentThread.CurrentCulture = CultureInfo.InvariantCulture;                     var item = (TItem) serializer.ReadObject(stream);                     Thread.CurrentThread.CurrentCulture = currentCulture;                     return item;                 }             }             catch             {                 return default(TItem);             }         }     } <\/code><\/pre>\n<p>  \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u0432\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0435\u0439 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u043e\u0436\u0435 \u043d\u0435 \u0441\u043b\u043e\u0436\u043d\u043e.<\/p>\n<pre><code class=\"cs\">    [DataContract]     public class ViewModelBase : PropertyNameProvider, INotifyPropertyChanging, INotifyPropertyChanged     {         protected Dictionary&lt;string, object&gt; Values = new Dictionary&lt;string, object&gt;();         private const string IndexerName = System.Windows.Data.Binding.IndexerName; \/* &quot;Item[]&quot; *\/         public event PropertyChangingEventHandler PropertyChanging = (sender, args) =&gt; { };         public event PropertyChangedEventHandler PropertyChanged = (sender, args) =&gt; { };          public object this[string key]         {             get { return Values.ContainsKey(key) ? Values[key] : null; }             set             {                 RaisePropertyChanging(IndexerName);                 if (Values.ContainsKey(key)) Values[key] = value;                 else Values.Add(key, value);                 RaisePropertyChanged(IndexerName);             }         }          public object this[string key, object defaultValue]         {             get             {                 if (Values.ContainsKey(key)) return Values[key];                 Values.Add(key, defaultValue);                 return defaultValue;             }             set { this[key] = value; }         }          public void RaisePropertyChanging(string propertyName)         {             PropertyChanging(this, new PropertyChangingEventArgs(propertyName));         }          public void RaisePropertyChanged(string propertyName)         {             PropertyChanged(this, new PropertyChangedEventArgs(propertyName));         }          [OnDeserializing]         private void Initialize(StreamingContext context = default(StreamingContext))         {             if (PropertyChanging == null) PropertyChanging = (sender, args) =&gt; { };             if (PropertyChanged == null) PropertyChanged = (sender, args) =&gt; { };             if (Values == null) Values = new Dictionary&lt;string, object&gt;();         }     } <\/code><\/pre>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0443\u043d\u0430\u0441\u043b\u0435\u0434\u0443\u0435\u043c\u0441\u044f \u043e\u0442 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 PropertyNameProvider, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430\u043c \u0432 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043b\u044f\u043c\u0431\u0434\u0430-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f\u043c\u0438.<\/p>\n<pre><code class=\"cs\">    [DataContract]     public class PropertyNameProvider     {         public static string GetPropertyName&lt;T&gt;(Expression&lt;Func&lt;T&gt;&gt; expression)         {             var memberExpression = expression.Body as MemberExpression;             var unaryExpression = expression.Body as UnaryExpression;              if (unaryExpression != null)                 memberExpression = unaryExpression.Operand as MemberExpression;              if (memberExpression == null || memberExpression.Member.MemberType != MemberTypes.Property)                 throw new Exception(&quot;Invalid lambda expression format.&quot;);              return memberExpression.Member.Name;         }     } <\/code><\/pre>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e, \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430\u043c-\u0438\u043d\u0434\u0430\u043a\u0441\u0430\u043c. \u0412 xaml \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0432\u0438\u0434\u0430 <\/p>\n<p>  Height=&quot;{Binding &#8216;[Height, 600]&#8217;, Mode=TwoWay}&quot; <\/p>\n<p>  \u0433\u0434\u0435 \u043f\u0435\u0440\u0432\u044b\u0439 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 \u2014 \u044d\u0442\u043e \u0438\u043c\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 (\u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0439) \u2014 \u0435\u0433\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435.<\/p>\n<p>  \u042d\u0442\u043e\u0442 \u043f\u043e\u0434\u0445\u043e\u0434 \u0447\u0435\u043c-\u0442\u043e \u043d\u0430\u043f\u043e\u043c\u0438\u043d\u0430\u0435\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 IDataErrorInfo. \u041f\u043e\u0447\u0435\u043c\u0443 \u0431\u044b \u043d\u0430\u043c \u0442\u043e\u0436\u0435 \u043d\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0435\u0433\u043e? \u0425\u043e\u0440\u043e\u0448\u0430\u044f \u0438\u0434\u0435\u044f, \u043d\u043e \u043d\u0435 \u0441\u0442\u0430\u043d\u0435\u043c \u0441\u043f\u0435\u0448\u0438\u0442\u044c, \u0430 \u043f\u0440\u0438\u043c\u0435\u043c \u0435\u0451 \u0432\u043e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435\u2026 \u041f\u043e\u0438\u0433\u0440\u0430\u0435\u043c \u0435\u0449\u0451 \u0441 \u043f\u0435\u0440\u0435\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0442\u043e\u0440\u0430. \u0412\u0441\u0435 \u043f\u043e\u043c\u043d\u044f\u0442 \u043f\u0440\u043e ICommand, \u0430 \u0432 WPF \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u0435\u0449\u0451 \u043a\u0440\u0443\u0442\u043e\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0440\u0430\u0431\u043e\u0442\u044b RoutedCommands \u0438 CommandBindings. \u0412\u043e\u0442 \u0431\u044b\u043b\u043e \u0431\u044b \u043a\u043b\u0430\u0441\u0441\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043a\u043e\u043c\u0430\u043d\u0434 \u0432\u043e \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<pre><code class=\"cs\">            this[ApplicationCommands.Save].CanExecute += (sender, args) =&gt; args.CanExecute = HasChanged;             this[ApplicationCommands.New].CanExecute += (sender, args) =&gt;             {                 args.CanExecute = !string.IsNullOrEmpty(FileName) || !string.IsNullOrEmpty(Text);             };              this[ApplicationCommands.Help].Executed += (sender, args) =&gt; MessageBox.Show(&quot;Muse 2014&quot;);             this[ApplicationCommands.Open].Executed += (sender, args) =&gt; Open();             this[ApplicationCommands.Save].Executed += (sender, args) =&gt; Save();             this[ApplicationCommands.SaveAs].Executed += (sender, args) =&gt; SaveAs();             this[ApplicationCommands.Close].Executed += (sender, args) =&gt; Environment.Exit(0);             this[ApplicationCommands.New].Executed += (sender, args) =&gt;             {                 Text = string.Empty;                 FileName = null;                 HasChanged = false;             }; <\/code><\/pre>\n<p>  \u041d\u0443, \u043a\u0430\u043a\u0430\u044f \u0436\u0435 \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u044c \u0431\u0435\u0437 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043d\u043e\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0438 \u043b\u044f\u0431\u0434\u0430-\u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0439? \u042d\u0442\u043e \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e-\u043b\u044e\u0431\u043e\u043c\u0443.<\/p>\n<pre><code class=\"cs\">        public string Text         {             get { return Get(() =&gt; Text); }             set { Set(() =&gt; Text, value); }         } <\/code><\/pre>\n<p>  \u0410 \u0447\u0442\u043e \u0435\u0441\u043b\u0438\u2026 \u0421\u043e\u0437\u0434\u0430\u0442\u044c PropertyBinding \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 CommandBinding \u0438 \u0441\u043e\u0432\u0441\u0435\u043c \u0447\u0443\u0442\u044c-\u0447\u0443\u0442\u044c \u0441\u043d\u043e\u0432\u0430 \u043f\u043e\u0438\u0433\u0440\u0430\u0442\u044c \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0442\u043e\u0440\u043e\u043c?<\/p>\n<pre><code class=\"cs\">       this[() =&gt; Text].PropertyChanged += (sender, args) =&gt; HasChanged = true;        this[() =&gt; FontSize].Validation += () =&gt; 4.0 &lt; FontSize && FontSize &lt; 128.0 ? null : &quot;Invalid font size&quot;; <\/code><\/pre>\n<p>  \u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043d\u0435\u043f\u043b\u043e\u0445\u043e, \u043d\u0435\u043f\u0440\u0430\u0432\u0434\u0430 \u043b\u0438? <\/p>\n<p>  \u0418, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u043d\u0430\u0448\u0430 \u0447\u0443\u0434\u043e-\u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u044c.<\/p>\n<pre><code class=\"cs\">    [DataContract]     public class ViewModel : ViewModelBase, IDataErrorInfo     {         public ViewModel()         {             Initialize();         }          string IDataErrorInfo.this[string propertyName]         {             get             {                 return PropertyBindings.ContainsKey(propertyName)                     ? PropertyBindings[propertyName].InvokeValidation()                     : null;             }         }          public PropertyBinding this[Expression&lt;Func&lt;object&gt;&gt; expression]         {             get             {                 var propertyName = GetPropertyName(expression);                 if (!PropertyBindings.ContainsKey(propertyName))                     PropertyBindings.Add(propertyName, new PropertyBinding(propertyName));                 return PropertyBindings[propertyName];             }         }          public CommandBinding this[ICommand command]         {             get             {                 if (!CommandBindings.ContainsKey(command))                     CommandBindings.Add(command, new CommandBinding(command));                 return CommandBindings[command];             }         }          public string Error { get; protected set; }         public Dictionary&lt;ICommand, CommandBinding&gt; CommandBindings { get; private set; }         public Dictionary&lt;string, PropertyBinding&gt; PropertyBindings { get; private set; }         public CancelEventHandler OnClosing = (o, e) =&gt; { };          public TProperty Get&lt;TProperty&gt;(Expression&lt;Func&lt;TProperty&gt;&gt; expression, TProperty defaultValue = default(TProperty))         {             var propertyName = GetPropertyName(expression);             if (!Values.ContainsKey(propertyName))                 Values.Add(propertyName, defaultValue);             return (TProperty) Values[propertyName];         }          public void Set&lt;TProperty&gt;(Expression&lt;Func&lt;TProperty&gt;&gt; expression, TProperty value)         {             var propertyName = GetPropertyName(expression);             RaisePropertyChanging(propertyName);             if (!Values.ContainsKey(propertyName))                 Values.Add(propertyName, value);             else Values[propertyName] = value;             RaisePropertyChanged(propertyName);         }          public void RaisePropertyChanging&lt;TProperty&gt;(Expression&lt;Func&lt;TProperty&gt;&gt; expression)         {             var propertyName = GetPropertyName(expression);             RaisePropertyChanging(propertyName);         }          public void RaisePropertyChanged&lt;TProperty&gt;(Expression&lt;Func&lt;TProperty&gt;&gt; expression)         {             var propertyName = GetPropertyName(expression);             RaisePropertyChanged(propertyName);         }          [OnDeserializing]         private void Initialize(StreamingContext context = default(StreamingContext))         {             CommandBindings = new Dictionary&lt;ICommand, CommandBinding&gt;();             PropertyBindings = new Dictionary&lt;string, PropertyBinding&gt;();             PropertyChanging += OnPropertyChanging;             PropertyChanged += OnPropertyChanged;         }          private void OnPropertyChanging(object sender, PropertyChangingEventArgs e)         {             var propertyName = e.PropertyName;             if (!PropertyBindings.ContainsKey(propertyName)) return;             var binding = PropertyBindings[propertyName];             if (binding != null) binding.InvokePropertyChanging(sender, e);         }          private void OnPropertyChanged(object sender, PropertyChangedEventArgs e)         {             var propertyName = e.PropertyName;             if (!PropertyBindings.ContainsKey(propertyName)) return;             var binding = PropertyBindings[propertyName];             if (binding != null) binding.InvokePropertyChanged(sender, e);         }     } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u0432\u043e\u043e\u0440\u0443\u0436\u0435\u043d\u044b \u043f\u043e \u043f\u043e\u043b\u043d\u043e\u0439, \u043d\u043e \u043d\u0435\u0442 \u043f\u0440\u0435\u0434\u0435\u043b\u0430 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u0441\u0442\u0432\u0443. \u041a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e, \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u044c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u043e \u0441\u0432\u043e\u0438\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435\u043c (\u0432\u044c\u044e) \u0432 C# \u043a\u043e\u0434\u0435, \u043d\u043e \u043d\u0430\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u044b \u0431\u044b\u043b\u043e \u043a\u0440\u0430\u0441\u0438\u0432\u043e \u044d\u0442\u0443 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 xaml! \u041f\u043e\u043c\u043d\u0438\u0442\u0435 \u043f\u0440\u043e \u043d\u0430\u0448 \u043e\u0442\u043a\u0430\u0437 \u043e\u0442 \u0438\u043d\u0436\u0435\u043a\u0446\u0438\u0439 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440? \u0412\u043e\u0442 \u043e\u043d \u043d\u0430\u043c \u0438 \u0434\u0430\u0451\u0442 \u0442\u0430\u043a\u0443\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c. \u041d\u0430\u043f\u0438\u0448\u0435\u043c \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0435 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438*.<\/p>\n<pre><code class=\"cs\">    public class StoreExtension : MarkupExtension     {         public StoreExtension(Type itemType)         {             ItemType = itemType;         }          [ConstructorArgument(&quot;ItemType&quot;)]         public Type ItemType { get; set; }          public override object ProvideValue(IServiceProvider serviceProvider)         {             var service = (IProvideValueTarget) serviceProvider.GetService(typeof (IProvideValueTarget));             var frameworkElement = service.TargetObject as FrameworkElement;             var dependancyProperty = service.TargetProperty as DependencyProperty;             var methodInfo = typeof(Store).GetMethod(&quot;OfType&quot;).MakeGenericMethod(ItemType);             var item = methodInfo.Invoke(null, new object[] { new object[0] });             if (frameworkElement != null &&                 dependancyProperty == FrameworkElement.DataContextProperty &&                 item is ViewModel)             {                 var viewModel = (ViewModel) item;                 frameworkElement.CommandBindings.AddRange(viewModel.CommandBindings.Values);                 var window = frameworkElement as Window;                 if (window != null)                     viewModel.OnClosing += (o, e) =&gt; { if (!e.Cancel) window.Close(); };                 frameworkElement.Initialized += (sender, args) =&gt; frameworkElement.DataContext = viewModel;                 return null;             }              return item;         }     } <\/code><\/pre>\n<p>  \u0412\u0443\u0430\u043b\u044f, \u0433\u043e\u0442\u043e\u0432\u043e! <\/p>\n<p>  DataContext=&quot;{Store viewModels:MainViewModel}&quot;<\/p>\n<p>  \u041e\u0431\u0440\u0430\u0449\u0430\u044e \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0438 \u0443 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u0430 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e DataContext, \u043d\u043e \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f CommandBindings, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0438\u0437 \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>  (* \u0447\u0442\u043e\u0431\u044b \u043f\u0435\u0440\u0435\u0434 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f\u043c\u0438 \u0434\u043b\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438 \u043d\u0435 \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0435\u0444\u0438\u043a\u0441\u043e\u0432 \u0432\u0440\u043e\u0434\u0435 &quot;{foundation:Store viewModels:MainViewModel}&quot;, \u043e\u043d\u0438 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0438 \u0432 \u044d\u0442\u043e\u043c \u0436\u0435 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0432 \u0444\u0430\u0439\u0434\u0435 AssemblyInfo.cs \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435  <\/p>\n<pre><code class=\"cs\">[assembly: XmlnsDefinition(&quot;http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation&quot;, &quot;Foundation&quot;)] [assembly: XmlnsDefinition(&quot;http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation&quot;, &quot;Foundation.Converters&quot;)] [assembly: XmlnsDefinition(&quot;http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation&quot;, &quot;Foundation.MarkupExtensions&quot;)]<\/code><\/pre>\n<p>)<\/p>\n<p>  \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0438\u0443\u043a\u0440\u0430\u0441\u0438\u043c \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 \u043a \u0438\u043d\u0434\u0435\u043a\u0441\u0430\u043c, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0435\u0447\u044c \u0448\u043b\u0430 \u0432\u044b\u0448\u0435. <\/p>\n<pre><code class=\"cs\">    public class ViewModelExtension : MarkupExtension     {         private static readonly BooleanConverter BooleanToVisibilityConverter = new BooleanConverter         {             OnTrue = Visibility.Visible,             OnFalse = Visibility.Collapsed,         };          private FrameworkElement _targetObject;         private DependencyProperty _targetProperty;          public ViewModelExtension()         {         }          public ViewModelExtension(string key)         {             Key = key;         }          public ViewModelExtension(string key, object defaultValue)         {             Key = key;             DefaultValue = defaultValue;         }          public string Key { get; set; }         public string StringFormat { get; set; }         public string ElementName { get; set; }         public object DefaultValue { get; set; }         public object FallbackValue { get; set; }         public object TargetNullValue { get; set; }         public IValueConverter Converter { get; set; }         public RelativeSource RelativeSource { get; set; }          public override object ProvideValue(IServiceProvider serviceProvider)         {             var service = (IProvideValueTarget) serviceProvider.GetService(typeof (IProvideValueTarget));             _targetProperty = service.TargetProperty as DependencyProperty;             _targetObject = service.TargetObject as FrameworkElement;             if (_targetObject == null || _targetProperty == null) return this;              var key = Key;             if (_targetProperty == UIElement.VisibilityProperty && string.IsNullOrWhiteSpace(key))                 key = string.Format(&quot;Show{0}&quot;,                                     string.IsNullOrWhiteSpace(_targetObject.Name)                                         ? _targetObject.Tag                                         : _targetObject.Name);              key = string.IsNullOrWhiteSpace(key) ? _targetProperty.Name : key;             if (!string.IsNullOrWhiteSpace(StringFormat)) Key = string.Format(StringFormat, _targetObject.Tag);              var index = DefaultValue == null ? key : key + &quot;,&quot; + DefaultValue;             var path = string.IsNullOrWhiteSpace(ElementName) && RelativeSource == null                            ? &quot;[&quot; + index + &quot;]&quot;                            : &quot;DataContext[&quot; + index + &quot;]&quot;;              if (_targetProperty == UIElement.VisibilityProperty && Converter == null)                 Converter = BooleanToVisibilityConverter;              var binding = new Binding(path) {Mode = BindingMode.TwoWay, Converter = Converter};             if (ElementName != null) binding.ElementName = ElementName;             if (FallbackValue != null) binding.FallbackValue = FallbackValue;             if (TargetNullValue != null) binding.TargetNullValue = TargetNullValue;              if (RelativeSource != null) binding.RelativeSource = RelativeSource;              _targetObject.SetBinding(_targetProperty, binding);             return binding.ProvideValue(serviceProvider);         }     } <\/code><\/pre>\n<p>  \u0412 xaml \u043c\u043e\u0436\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u0442\u0430\u043a:<\/p>\n<p>  Width=&quot;{ViewModel DefaultValue=800}&quot;<\/p>\n<p>  <b>\u0418\u0442\u043e\u0433\u0438<\/b><\/p>\n<p>  \u041f\u043e\u0436\u0430\u043b\u0443\u0439, \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u044f \u043f\u0440\u0435\u043f\u043e\u0434\u043d\u0451\u0441 \u043c\u043d\u043e\u0433\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u0441\u0436\u0430\u0442\u043e\u043c \u0432\u0438\u0434\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0434\u043b\u044f \u043f\u043e\u043b\u043d\u043e\u0442\u044b \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043b\u0443\u0447\u0448\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u0430. <\/p>\n<p>  \u0420\u0435\u0437\u044e\u043c\u0438\u0440\u0443\u044f \u0432\u0441\u0451 \u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043b\u044e\u0441\u044b \u043f\u043e\u0434\u0445\u043e\u0434\u0430:<br \/>   \u2014 \u0447\u0438\u0441\u0442\u044b\u0439, \u043b\u0430\u043a\u043e\u043d\u0438\u0447\u043d\u044b\u0439 \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043e\u0434. \u0418\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u0441\u043b\u0430\u0431\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u0430\u044f \u0441 \u0431\u0438\u0437\u043d\u0435\u0441-\u043b\u043e\u0433\u0438\u043a\u043e\u0439, \u0438\u043d\u043a\u0430\u043f\u0441\u0443\u043b\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432 \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u0438, \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0442\u0443 \u043b\u043e\u0433\u0438\u043a\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0435\u0441\u043d\u043e \u0441\u0432\u044f\u0437\u0430\u043d\u0430 \u0441 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u0430\u0432\u0438\u043b\u0430\u043c\u0438;<br \/>   \u2014 \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u0430 \u0438 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f. \u041a\u043e \u0432\u0441\u0435\u043c\u0443 \u043f\u0440\u043e\u0447\u0435\u043c\u0443, \u0441\u0435\u0440\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0447\u0435\u043d\u044c \u0433\u0438\u0431\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432;<br \/>   \u2014 \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 IDataErrorInfo.<\/p>\n<p>  \u041c\u0438\u043d\u0443\u0441\u044b:<br \/>   \u2014 \u043e\u0442\u043a\u0430\u0437 \u043e\u0442 \u0438\u043d\u0436\u0435\u043a\u0446\u0438\u0439 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 (\u0445\u043e\u0442\u044f \u044d\u0442\u043e \u0438 \u043d\u0435 \u043e\u0431\u044f\u0437\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u0435);<br \/>   \u2014 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043d\u0435\u044f\u0432\u043d\u043e\u0441\u0442\u044c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u043d\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u043e\u0433\u043e \u0441 \u043d\u0438\u043c.<\/p>\n<p>  <b>\u041e\u0441\u0432\u043e\u0438\u0432 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u0438 \u0438\u043c\u0435\u044f \u0432 \u0440\u0430\u0441\u043f\u043e\u0440\u044f\u0436\u0435\u043d\u0438\u0438 \u0432\u0441\u0435\u0433\u043e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u0432\u044b \u0441\u043c\u043e\u0436\u0435\u0442\u0435 \u043a\u043e\u043c\u0444\u043e\u0440\u0442\u043d\u043e, \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u0438\u0441\u0430\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0441 \u0431\u043e\u0433\u0430\u0442\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0430\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044f \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u0438 \u0447\u0438\u0441\u0442\u044b\u043c\u0438 \u0438 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u043c\u0438.<\/b><\/p>\n<p>  \u041e\u0447\u0435\u043d\u044c \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0432\u0430\u0441 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439! \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435!<\/p>\n<p>  P.S. \u041d\u0435 \u0437\u043d\u0430\u044e \u0442\u043e\u0447\u043d\u043e, \u043a\u0430\u043a \u0432 Silverlight, \u043d\u043e \u043d\u0430 WinPhone-\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u044f (\u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u044e\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0438, RoutedCommands \u0438 CommandBindings), \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u0438 \u0431\u043e\u043b\u044c\u0448\u043e\u043c \u0436\u0435\u043b\u0430\u043d\u0438\u0438, \u0434\u0443\u043c\u0430\u044e, \u044d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043e\u0431\u043e\u0439\u0442\u0438.<\/p>\n<p>  P.P.S. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043b \u0432\u044b\u0448\u0435, \u0432\u0441\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b, \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u044b \u043c\u043d\u043e\u0439 \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430. \u0422\u0435, \u043a\u043e\u043c\u0443 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e, \u0447\u0442\u043e \u0436\u0435 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0437\u0430 \u0442\u0432\u043e\u0440\u0435\u043d\u0438\u0435, \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u0439\u0442\u0438 \u0435\u0433\u043e \u043f\u043e <a href=\"http:\/\/poet.of.by\/ru\/\">\u044d\u0442\u043e\u0439 \u0441\u0441\u044b\u043b\u043a\u0435<\/a>. \u041c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e <b>\u0432 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0438 \u043f\u043e\u044d\u0437\u0438\u0438 \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0449\u0435\u0433\u043e<\/b>: \u0442\u0430\u043a\u0436\u0435 \u043a\u0430\u043a \u043c\u0430\u0441\u0442\u0435\u0440 \u0441\u043b\u043e\u0432\u0430 \u0441\u043f\u043e\u0441\u043e\u0431\u0435\u043d \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0444\u0440\u0430\u0437\u0430\u043c\u0438 \u0432\u044b\u0440\u0430\u0437\u0438\u0442\u044c \u0442\u043e, \u043d\u0430 \u0447\u0442\u043e \u0443 \u043e\u0431\u044b\u0447\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430 \u0443\u0439\u0434\u0435\u0442 \u043d\u0435 \u043e\u0434\u0438\u043d \u0430\u0431\u0437\u0430\u0446, \u0442\u0430\u043a \u0438 \u043e\u043f\u044b\u0442\u043d\u044b\u0439 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442 \u0440\u0435\u0448\u0430\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u043c\u0438 \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043a\u043e\u0434\u0430. <\/p>\n<p>  \u0412\u0434\u043e\u0445\u043d\u043e\u0432\u0435\u043d\u0438\u044f \u0432\u0430\u043c! \t\t\t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/208326\/\"> http:\/\/habrahabr.ru\/post\/208326\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\"> \t\t\t<b>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/b><\/p>\n<p>  \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0437\u0430\u0434 \u044f \u0437\u0430\u0442\u0435\u044f\u043b \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0430 \u0441 \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u043e\u043c \u0438 \u0448\u0438\u0440\u043e\u043a\u0438\u043c \u0443\u0434\u043e\u0431\u043d\u044b\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u043e\u043c \u043d\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0435 WPF. \u0414\u043e\u0432\u0435\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c \u043e\u0447\u0435\u043d\u044c \u043c\u043d\u043e\u0433\u043e \u0442\u0435\u0445\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443 \u043c\u0435\u043d\u044f \u043d\u0430\u043a\u043e\u043f\u0438\u043b\u0441\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0451\u043d\u043d\u044b\u0439 \u043e\u043f\u044b\u0442, \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0445\u043e\u0447\u0443 \u043f\u043e\u0434\u0435\u043b\u0438\u0442\u044c\u0441\u044f \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u043b\u044e\u0434\u044c\u043c\u0438.<\/p>\n<p>  <b>\u041a \u0434\u0435\u043b\u0443<\/b><\/p>\n<p>  \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c WPF, Silverlight \u0438 WinPhone-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0445\u043e\u0440\u043e\u0448\u043e \u0437\u043d\u0430\u043a\u043e\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d \u043f\u0440\u043e\u0435\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f MVVM (Model \u2014 View \u2014 ViewModel). \u041e\u0434\u043d\u0430\u043a\u043e \u0435\u0441\u043b\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u043a \u043d\u0435\u043c\u0443 \u0435\u0449\u0451 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0444\u0430\u043d\u0442\u0430\u0437\u0438\u0438, \u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e\u0435, \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0434\u0430\u0436\u0435, \u043e\u0441\u043c\u0435\u043b\u044e\u0441\u044c \u0437\u0430\u0432\u0435\u0440\u0438\u0442\u044c, \u0440\u0435\u0432\u043e\u043b\u044e\u0446\u0438\u043e\u043d\u043d\u043e\u0435. <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-208326","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208326","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=208326"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208326\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208326"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208326"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208326"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}