{"id":172839,"date":"2013-03-15T08:38:03","date_gmt":"2013-03-15T04:38:03","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=172839"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=172839","title":{"rendered":"<span class=\"post_title\">\u0412\u0430\u0440\u0438\u043c MVVM \u0434\u043b\u044f Windows Store-\u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u0434 Windows 8, \u043c\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Model-View-ViewModel (MVVM) \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u0442\u0430\u043a\u043e\u0432\u043e\u0439, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432 \u043f\u0440\u0438\u0440\u043e\u0434\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u044b \u043f\u043b\u043e\u0445\u043e \u0438\u0441\u043a\u0430\u043b\u0438, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u0442\u0430\u043a \u0432\u0430\u0436\u043d\u043e). \u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c?\u00bb \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u043b\u0441\u044f \u0441\u0430\u043c\u2026<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/389\/7be\/3b1\/3897be3b10a424079983122ab8e2449b.png\"\/><\/p>\n<p>  \u0412 \u043d\u0435\u0434\u0440\u0430\u0445 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 EastBanc Technologies \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 (\u043a\u043e\u0434\u043e\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 <b>EBT.Mvvm<\/b>). \u0426\u0435\u043b\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u2014 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f Windows 8. \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432\u043e\u0448\u043b\u0438 \u043a\u0430\u043a \u043d\u0430\u0448\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0442\u0430\u043a \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0435\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u0438\u0441\u043a\u043e\u0432.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c: \u0432\u0441\u0435 \u043f\u043e\u043c\u043d\u044f\u0442, \u0447\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u2014 \u044d\u0442\u043e \u043e\u0441\u043b\u0430\u0431\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 ViewModel (\u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u044c) \u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e View (\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435). \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 code-behind \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441 InitializeComponent \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0434 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 XAML. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0442\u0434\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u0443, \u0430 \u0441\u0430\u043c \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0430 C# \u0438 XAML \u043f\u043e\u0434 Windows 8. \u041d\u0438\u0436\u0435 \u043c\u044b \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0438\u0447 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0434\u0430 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432. \u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438:<\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<h5>1. \u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 ViewModel<\/h5>\n<p>  \u041f\u0435\u0440\u0432\u043e\u0435, \u0441 \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0442\u044c, \u0433\u043e\u0432\u043e\u0440\u044f \u043e MVVM \u0448\u0430\u0431\u043b\u043e\u043d\u0435, \u044d\u0442\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u0435\u0439. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u2014 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 INotifyPropertyChanged \u0438 \u0443\u0434\u043e\u0431\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \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 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432. \u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cs\">public class SimpleViewModel : ViewModel   {       private int _number;          public int Number       {           get { return _number; }           set { OnPropertyChange(ref _number, value); }       }   }   <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0432\u0441\u0451 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u043f\u043e\u043d\u044f\u0442\u043d\u043e \u0431\u0435\u0437 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432. \u0421\u043b\u0435\u0434\u0443\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430\u0431\u043e\u0440 \u043f\u0435\u0440\u0435\u0433\u0440\u0443\u0436\u0435\u043d\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0434\u043b\u044f \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 \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430. \u0422\u0430\u043a\u0436\u0435 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u0441\u043f\u043e\u0441\u043e\u0431 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u044f \u0432\u043e\u043e\u0431\u0449\u0435. \u0418\u043c\u0435\u0435\u0442\u0441\u044f \u0432 \u0432\u0438\u0434\u0443 \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 backing field. \u041f\u0440\u0438\u043c\u0435\u0440 \u2014 \u043f\u043e\u043b\u0435 _number \u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043a\u043e\u0434\u0430 \u0432\u044b\u0448\u0435. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u043e\u0439 \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. \u042d\u0442\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e, \u0435\u0441\u043b\u0438 \u0432\u043e \u0432\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432 \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f. \u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u0441 \u0443\u0447\u0451\u0442\u043e\u043c \u044d\u0442\u043e\u0439 \u0444\u0438\u0447\u0438 (\u043f\u043e\u043b\u0435 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f).<\/p>\n<pre><code class=\"cs\">public string Text { \tget { return GetPropertyValue(() =&gt; Text); } \tset { SetPropertyValue(() =&gt; Text, value); } }  <\/code><\/pre>\n<h5>2. \u041a\u043e\u043c\u0430\u043d\u0434\u044b<\/h5>\n<p>  \u041f\u0440\u0438\u0432\u044b\u0447\u043d\u044b\u0439 \u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043a\u043e\u043c\u0430\u043d\u0434 RelayCommand. \u041f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 Command \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 ButtonBase (\u043a\u043d\u043e\u043f\u043a\u0438, \u043f\u0443\u043d\u043a\u0442\u044b \u043c\u0435\u043d\u044e, \u0433\u0438\u043f\u0435\u0440\u0441\u0441\u044b\u043b\u043a\u0438) \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 ICommand \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441. \u0412\u0435\u0449\u044c \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u0430\u044f \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u0430 \u0443\u0436\u0435 \u0434\u0430\u0432\u043d\u043e. \u0422\u0435\u043c \u043d\u0435 \u043c\u0435\u043d\u0435\u0435, \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c \u0443\u043f\u043e\u043c\u044f\u043d\u0443\u0442\u0430:<\/p>\n<pre><code class=\"cs\">public class SimpleViewModel : ViewModel {   \tpublic SimpleViewModel()   \t{   \t\tSampleCommand = new RelayCommand(OnSample);   \t}   \tpublic RelayCommand SampleCommand { get; private set; }      \tprivate void OnSample()   \t{ \t\t\/\/ TODO Do something here.   \t}   }   <\/code><\/pre>\n<pre><code class=\"xml\">&lt;Button Command=&quot;{Binding SampleCommand}&quot; Content=&quot;Button Text&quot; \/&gt; <\/code><\/pre>\n<h5>3. \u0421\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439<\/h5>\n<p>  \u041c\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. MVVM \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u0435\u0442, \u0447\u0442\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0434\u043e\u043b\u0436\u043d\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442\u044c \u043d\u0430 \u0441\u0442\u043e\u0440\u043e\u043d\u0435 \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u0438. \u0411\u0435\u0437 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0442\u0440\u044e\u043a\u0430 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043d\u0435\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e. \u041e\u043d \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0438 \u043f\u0440\u0438\u0441\u043e\u0435\u0434\u0438\u043d\u0451\u043d\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430. \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0421\u043f\u0438\u0441\u043e\u043a \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u0442\u044c \u0441\u0430\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0451\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u044f Tapped \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 TextBlock:<\/p>\n<pre><code class=\"cs\">public class SimpleViewModel   {   \tpublic SimpleViewModel()   \t{   \t\tTappedCommand = new EventCommand&lt;Point&gt;(OnTapped);   \t}   \tpublic IEventCommand TappedCommand { get; private set; }    \tprivate void OnTapped(Point point)   \t{   \t\tTappedCommand.PreventBubbling = point.X &lt; 100;   \t}   }   <\/code><\/pre>\n<pre><code class=\"xml\">&lt;TextBlock Mvvm:EventBinding.Tapped=&quot;{Binding TappedCommand}&quot; Text=&quot;Tap me&quot;\/&gt; <\/code><\/pre>\n<p>  \u0422\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u043e\u0431\u0440\u0430\u0442\u0438\u0442\u044c \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 TappedCommand.PreventBubbling = point.X &lt; 100. \u0414\u0435\u043b\u043e \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u044b \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043e\u0442\u043c\u0435\u043d\u0438\u0442\u044c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0443\u044e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 (Handled) \u0432\u044b\u0441\u0442\u0430\u0432\u0438\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439 \u0444\u043b\u0430\u0433.<\/p>\n<p>  \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0435\u0441\u0442\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0439: SelectionChanged, Click, ItemClick, KeyDown, KeyUp, PointerReleased, PointerPressed, PointerMoved, PointerCanceled, PointerEntered, PointerExited, PointerCaptureLost, Tapped, RightTapped, PointerWheelChanged, ManipulationStarting, ManipulationStarted, ManipulationDelta, ManipulationInertiaStarting, ManipulationCompleted, LostFocus, Unloaded, Loaded.<\/p>\n<h5>4. \u041f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0440\u0435\u0436\u0438\u043c\u043e\u0432 \u044d\u043a\u0440\u0430\u043d\u0430<\/h5>\n<p>  \u041d\u0430 \u043d\u0430\u0448 \u0432\u0437\u0433\u043b\u044f\u0434, \u044d\u0442\u043e \u0441\u0430\u043c\u0430\u044f \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u0430\u044f \u0444\u0438\u0447\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0414\u043b\u044f \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u043f\u043b\u0430\u043d\u0448\u0435\u0442\u044b \u043f\u0440\u044f\u043c\u043e-\u0442\u0430\u043a\u0438 \u043d\u0435\u0437\u0430\u043c\u0435\u043d\u0438\u043c\u0430\u044f! \u041f\u043e\u043c\u043d\u0438\u043c, \u0447\u0442\u043e \u0435\u0441\u0442\u044c \u0447\u0435\u0442\u044b\u0440\u0435 \u0440\u0435\u0436\u0438\u043c\u0430 \u044d\u043a\u0440\u0430\u043d\u0430 \u0438 \u0447\u0442\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0438\u0445 \u0432\u0441\u0435 \u2014 \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0442\u043e\u043d. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430 \u044d\u043a\u0440\u0430\u043d\u0430. <\/p>\n<ul>\n<li>\u0423\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e. \u041e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0432\u0438\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438 \u0443\u0434\u043e\u0431\u0435\u043d \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432.<\/li>\n<li>\u0418\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0441\u0442\u0438\u043b\u044f. \u0418\u043d\u043e\u0433\u0434\u0430 \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u044d\u0442\u043e \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/li>\n<\/ul>\n<pre><code class=\"xml\">&lt;TextBlock behaviors:OrientationBehavior.Orientations=&quot;Landscape,Filled,Portrait&quot; Text=&quot;Not snapped&quot;\/&gt;     &lt;TextBlock behaviors:OrientationBehavior.Orientations=&quot;Snapped&quot; Text=&quot;Snapped&quot;\/&gt;    <\/code><\/pre>\n<p>  \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0440\u0435\u0436\u0438\u043c\u0430 \u044d\u043a\u0440\u0430\u043d\u0430. <\/p>\n<pre><code class=\"xml\">&lt;GridView ItemsSource=&quot;{Binding YourItems}&quot;&gt;          &lt;behaviors:OrientationBehavior.LandscapeStyle&gt;           &lt;!-- This style will be applied in landscape, filled and portrait modes. --&gt;           &lt;Style TargetType=&quot;ListViewBase&quot;\/&gt;       &lt;\/behaviors:OrientationBehavior.LandscapeStyle&gt;          &lt;behaviors:OrientationBehavior.SnappedStyle&gt;           &lt;!-- This style will be applied in the snapped mode. --&gt;           &lt;Style TargetType=&quot;ListViewBase&quot;&gt;               &lt;Style.Setters&gt;                   &lt;Setter Property=&quot;ScrollViewer.HorizontalScrollBarVisibility&quot; Value=&quot;Disabled&quot;\/&gt;                   &lt;Setter Property=&quot;ScrollViewer.HorizontalScrollMode&quot; Value=&quot;Disabled&quot;\/&gt;                   &lt;Setter Property=&quot;ScrollViewer.VerticalScrollBarVisibility&quot; Value=&quot;Auto&quot;\/&gt;                   &lt;Setter Property=&quot;ScrollViewer.VerticalScrollMode&quot; Value=&quot;Auto&quot;\/&gt;                   &lt;Setter Property=&quot;ItemsPanel&quot;&gt;                       &lt;Setter.Value&gt;                           &lt;ItemsPanelTemplate&gt;                               &lt;VirtualizingStackPanel Orientation=&quot;Vertical&quot;\/&gt;                           &lt;\/ItemsPanelTemplate&gt;                       &lt;\/Setter.Value&gt;                   &lt;\/Setter&gt;               &lt;\/Style.Setters&gt;           &lt;\/Style&gt;       &lt;\/behaviors:OrientationBehavior.SnappedStyle&gt;   &lt;\/GridView&gt; <\/code><\/pre>\n<p>  \u041c\u0435\u0442\u043e\u0434 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u2014 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u0430\u044f \u0438 \u043c\u043e\u0449\u043d\u0430\u044f \u0444\u0438\u0447\u0430. \u041f\u0440\u0438 \u0435\u0451 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u043d\u0438\u0442\u044c \u043f\u0440\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<ul>\n<li>\u041f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u044d\u0442\u043e\u0439 \u0444\u0438\u0447\u0438 \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e Style \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/li>\n<li>\u0415\u0441\u043b\u0438 \u043f\u0440\u0438\u043c\u0435\u043d\u0451\u043d \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u0437 \u0440\u0435\u0436\u0438\u043c\u043e\u0432 \u044d\u043a\u0440\u0430\u043d\u0430, \u0442\u043e \u043a\u0430\u043a \u043c\u0438\u043d\u0438\u043c\u0443\u043c \u044d\u0442\u043e\u0442 \u0441\u0442\u0438\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0440\u0435\u0436\u0438\u043c\u0430\u0445 \u0435\u0441\u043b\u0438 \u043d\u0435 \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u0434\u0440\u0443\u0433\u0438\u0435.<\/li>\n<li>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u0440\u0435\u0436\u0438\u043c\u043e\u0432 \u044d\u043a\u0440\u0430\u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u0442\u0438\u043b\u0435\u0439 \u0438\u043c\u0435\u0435\u0442 \u043f\u0440\u0438\u043e\u0440\u0438\u0442\u0435\u0442. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0441\u0442\u0438\u043b\u044c \u0434\u043b\u044f \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043d\u043e\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0438 \u0434\u043b\u044f snapped, \u0442\u043e \u043f\u043e\u0440\u0442\u0440\u0435\u0442\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0434\u043b\u044f \u043b\u0430\u043d\u0434\u0448\u0430\u0444\u0442\u043d\u043e\u0433\u043e \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0436\u0438\u043c\u0430. \u0415\u0441\u043b\u0438 \u0443\u043a\u0430\u0437\u0430\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u0441\u0442\u0438\u043b\u044c \u2014 \u043e\u043d \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0432\u043e \u0432\u0441\u0435\u0445 \u0440\u0435\u0436\u0438\u043c\u0430\u0445.<\/li>\n<\/ul>\n<p>  \u0410 \u043f\u0440\u0438\u044f\u0442\u043d\u043e\u0435 \u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u0435 \u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0438\u043b\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u043f\u0440\u0438 \u0442\u0430\u043a\u043e\u043c \u043f\u043e\u0434\u0445\u043e\u0434\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f ContentControl\/ContentPresenter, \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c view template \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e! \u041d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u043a\u0430\u043a \u044d\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u0442\u0441\u044f:<\/p>\n<pre><code class=\"xml\">&lt;Grid Name=&quot;main&quot;&gt;       &lt;ContentControl&gt;           &lt;behaviors:OrientationBehavior.LandscapeStyle&gt;               &lt;Style TargetType=&quot;ContentControl&quot;&gt;                   &lt;Setter Property=&quot;ContentTemplate&quot;&gt;                       &lt;Setter.Value&gt;                           &lt;DataTemplate&gt;                               &lt;Grid&gt;                                   &lt;TextBlock Text=&quot;Landscape&quot;\/&gt;                                   &lt;!-- Something in landscape mode --&gt;                               &lt;\/Grid&gt;                           &lt;\/DataTemplate&gt;                       &lt;\/Setter.Value&gt;                   &lt;\/Setter&gt;               &lt;\/Style&gt;           &lt;\/behaviors:OrientationBehavior.LandscapeStyle&gt;           &lt;behaviors:OrientationBehavior.PortraitStyle&gt;               &lt;Style TargetType=&quot;ContentControl&quot;&gt;                   &lt;Setter Property=&quot;ContentTemplate&quot;&gt;                       &lt;Setter.Value&gt;                           &lt;DataTemplate&gt;                               &lt;Grid&gt;                                   &lt;TextBlock Text=&quot;Portrait&quot;\/&gt;                                   &lt;!-- Something in portrait mode --&gt;                               &lt;\/Grid&gt;                           &lt;\/DataTemplate&gt;                       &lt;\/Setter.Value&gt;                   &lt;\/Setter&gt;               &lt;\/Style&gt;           &lt;\/behaviors:OrientationBehavior.PortraitStyle&gt;           &lt;behaviors:OrientationBehavior.SnappedStyle&gt;               &lt;Style TargetType=&quot;ContentControl&quot;&gt;                   &lt;Setter Property=&quot;ContentTemplate&quot;&gt;                       &lt;Setter.Value&gt;                           &lt;DataTemplate&gt;                               &lt;Grid&gt;                                   &lt;TextBlock Text=&quot;Snapped. Only text here&quot;\/&gt;                               &lt;\/Grid&gt;                           &lt;\/DataTemplate&gt;                       &lt;\/Setter.Value&gt;                   &lt;\/Setter&gt;               &lt;\/Style&gt;           &lt;\/behaviors:OrientationBehavior.SnappedStyle&gt;       &lt;\/ContentControl&gt;   &lt;\/Grid&gt;   <\/code><\/pre>\n<p>  \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0431\u0435\u0437 \u043b\u0438\u0448\u043d\u0438\u0445 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u0432 snapped \u0440\u0435\u0436\u0438\u043c. <\/p>\n<h5>5. \u0412\u044b\u0437\u043e\u0432 \u043c\u0435\u0442\u043e\u0434\u043e\u0432 View \u0438\u0437 ViewModel<\/h5>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u044b\u0432\u0430\u0435\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 \u0438\u0437 \u0432\u044c\u044e \u043c\u043e\u0434\u0435\u043b\u0438. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0432\u0435\u0441\u0442\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0444\u043e\u043a\u0443\u0441 \u0432\u0432\u043e\u0434\u0430 \u043d\u0430 \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043d\u0430\u0448\u0435\u0433\u043e ControlWrapper:<\/p>\n<pre><code class=\"cs\">public class SimpleViewModel : ViewModel   {       public SimpleViewModel()       {           TextBoxWrapper = new ControlWrapper();       }       public ControlWrapper TextBoxWrapper { get; private set; }          public void GotoField()       {           TextBoxWrapper.Focus();       }   }   <\/code><\/pre>\n<pre><code class=\"xml\">&lt;TextBox Mvvm:ElementBinder.Wrapper=&quot;{Binding TextBoxWrapper}&quot;\/&gt; <\/code><\/pre>\n<h5>6. \u0422\u0440\u0438\u0433\u0433\u0435\u0440\u044b \u0441\u043e\u0431\u044b\u0442\u0438\u0439 \u0434\u043b\u044f \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u0438<\/h5>\n<p>  \u042d\u0442\u043e\u0442 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u0430\u043c \u0441\u0442\u0430\u0440\u0442\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0438\u043c\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 \u0432 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0418 \u043e\u043f\u044f\u0442\u044c \u043d\u0438 \u0441\u0442\u0440\u043e\u0447\u043a\u0438 \u043a\u043e\u0434\u0430 \u0432 code-behind! \u041c\u0435\u0442\u043e\u0434 \u043e\u0441\u043d\u043e\u0432\u0430\u043d \u043d\u0430 \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0412 XAML \u043d\u0443\u0436\u043d\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443 TriggerCommand:<\/p>\n<pre><code class=\"xml\">&lt;Grid&gt;       &lt;FrameworkElement.Resources&gt;           &lt;Storyboard x:Key=&quot;FadeOut&quot;&gt;               &lt;PointerDownThemeAnimation Storyboard.TargetName=&quot;MyElement&quot;\/&gt;           &lt;\/Storyboard&gt;           &lt;Storyboard x:Key=&quot;FadeIn&quot;&gt;               &lt;PointerUpThemeAnimation Storyboard.TargetName=&quot;MyElement&quot;\/&gt;           &lt;\/Storyboard&gt;       &lt;\/FrameworkElement.Resources&gt;              &lt;Border x:Name=&quot;MyElement&quot; Width=&quot;100&quot; Height=&quot;100&quot; Background=&quot;Red&quot;&gt;              &lt;mvvm:EventBinding.PointerPressed&gt;               &lt;mvvm:TriggerCommand Storyboard=&quot;{StaticResource FadeOut}&quot;\/&gt;           &lt;\/mvvm:EventBinding.PointerPressed&gt;              &lt;mvvm:EventBinding.PointerReleased&gt;               &lt;mvvm:TriggerCommand Storyboard=&quot;{StaticResource FadeIn}&quot;\/&gt;           &lt;\/mvvm:EventBinding.PointerReleased&gt;          &lt;\/Border&gt;   &lt;\/Grid&gt; <\/code><\/pre>\n<h5>7. \u041f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0433\u043e \u043c\u0435\u043d\u044e<\/h5>\n<p>  ContextMenuBehavior \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0438 \u0443\u0434\u043e\u0431\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e \u043d\u0430 \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043f\u0440\u0430\u0432\u043e\u0439 \u043a\u043b\u0430\u0432\u0438\u0448\u0438 \u043c\u044b\u0448\u0438 \u0438\u043b\u0438 tap \u043d\u0430 \u0442\u0430\u0447\u0441\u043a\u0440\u0438\u043d\u0435. \u0412\u043e \u0432\u044c\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0435, \u0434\u043b\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0437\u0432\u0430\u043d\u043e \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u043d\u043e\u0435 \u043c\u0435\u043d\u044e. \u0410 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u0430\u043d\u0434 \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438:<\/p>\n<pre><code class=\"cpp\">public class MyViewModel : ViewModel   {       private IList&lt;UICommand&gt; _contextMenuCommands;       private string _text;          public string Text       {           get { return _text; }           set { OnPropertyChange(ref _text, value); }       }          public IList&lt;UICommand&gt; ContextMenuCommands       {           get           {               return _contextMenuCommands ?? (_contextMenuCommands = new List&lt;UICommand&gt;              {                   new UICommand(&quot;Copy&quot;, OnCopy),                   new UICommand(&quot;Paste&quot;, OnPaste),               });           }       }          private void OnCopy(IUICommand command)       {           var content = new DataPackage();           content.SetText(Text);           Clipboard.SetContent(content);       }          private async void OnPaste(IUICommand command)       {           var content = Clipboard.GetContent();           Text = await content.GetTextAsync();       }   }   <\/code><\/pre>\n<pre><code class=\"xml\">&lt;TextBlock behaviors:ContextMenuBehavior.Commands=&quot;{Binding ContextMenuCommands}&quot; Text=&quot;{Binding Text}&quot; MinWidth=&quot;300&quot; Height=&quot;40&quot;\/&gt; <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/01a\/469\/ca3\/01a469ca3483210d01588296908cfba9.png\"\/> <\/p>\n<h5>8. \u041f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 popup<\/h5>\n<p>  PopupBehavior \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u043f\u043e\u043a\u0430\u0437\u0430 popup \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043f\u0440\u0430\u0432\u0443\u044e \u043a\u043d\u043e\u043f\u043a\u0443 \u043c\u044b\u0448\u0438 \u0438\u043b\u0438 tap \u043d\u0430 \u0442\u0430\u0447\u0441\u043a\u0440\u0438\u043d\u0435. \u0412\u0441\u0451 \u0434\u043e\u043b\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u044f\u0441\u043d\u043e \u0438\u0437 \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043a\u043e\u0434\u0430 \u043d\u0438\u0436\u0435:<\/p>\n<pre><code class=\"xml\">&lt;TextBlock Text=&quot;Tap or right click here for more information&quot; behaviors:PopupBehavior.Placement=&quot;Above&quot;&gt;       &lt;behaviors:PopupBehavior.Content&gt;           &lt;DataTemplate&gt;               &lt;TextBlock Text=&quot;More information...&quot;\/&gt;           &lt;\/DataTemplate&gt;       &lt;\/behaviors:PopupBehavior.Content&gt;   &lt;\/TextBlock&gt;   <\/code><\/pre>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/08d\/6a7\/78f\/08d6a778f42ca851a2264cc6649b9fa0.png\"\/><br \/>  \u2003  <\/p>\n<h5>9. \u041c\u0435\u0436\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u0430\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f<\/h5>\n<p>  \u041e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u0430\u044f \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044f \u2014 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u0442\u043e\u0442\u0443 code-behind, \u0435\u0441\u043b\u0438 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 \u043e\u0431\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a Frame \u0438\u0437 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f. \u0418 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043e\u0431\u044b\u0442\u0438\u0439 Navigating \u0438 Navigated \u0432\u043e \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u0438. <\/p>\n<p>  \u0414\u043b\u044f \u0434\u043e\u0441\u0442\u0438\u0436\u0435\u043d\u0438\u044f \u0446\u0435\u043b\u0435\u0439 \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f:<\/p>\n<pre><code class=\"cs\">public class RootModel {     public RootModel()     {         NavigationState = new NavigationState();         HomePageModel = new HomePageModel(this);     }     public NavigationState NavigationState { get; set; }     public HomePageModel HomePageModel { get; set; }      public bool CanGoBack { get { return NavigationState.CanGoBack; } }     public void GoBack()     {         NavigationState.GoBack();                 }     public void GoToHomePage()     {         NavigationState.Navigate(typeof (HomePage));     } } <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043e\u0441\u043d\u043e\u0432\u043d\u0443\u044e \u043c\u043e\u0434\u0435\u043b\u044c \u043a\u0430\u043a \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442 \u0432\u0435\u0440\u0445\u043d\u0435\u0443\u0440\u043e\u0432\u043d\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430 \u043e\u0431\u044a\u0435\u043a\u0442\u043e\u0432 \u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u043b\u0430\u0441\u0441-\u043e\u0431\u0451\u0440\u0442\u043a\u0443 NavigationState \u0441 frame.<\/p>\n<pre><code class=\"cs\">sealed partial class App : Application {     ...     public RootModel RootModel { get; private set; }      protected override void OnLaunched(LaunchActivatedEventArgs args)     {         RootModel = new RootModel();         var frame = new Frame { DataContext = RootModel };          \/\/ Bind the NavigationState and the frame using the ElementBinder class.         \/\/ You can also do this in XAML.         ElementBinder.SetWrapper(frame, RootModel.NavigationState);          Window.Current.Content = frame;         Window.Current.Activate();          RootModel.GoToHomePage();     } } <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0448\u0430 \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u044c HomePageModel \u043c\u043e\u0436\u0435\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f OnNavigating \u0438 OnNavigated. \u0410 \u0442\u0430\u043a\u0436\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u043d\u0430 \u0434\u0440\u0443\u0433\u0438\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u043d\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 _rootModel. \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e OnNavigating \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043e\u0442\u043c\u0435\u043d\u0443 \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 (\u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440 ref bool cancel).<\/p>\n<pre><code class=\"cs\">public class HomePageModel : PageModel \/\/ Or implement IPageModel. {     private RootModel _rootModel;   \/\/ You can call _rootModel.NavigationState.Navigate(\u2026)     public HomePageModel(RootModel rootModel)     {         _rootModel = rootModel;     }     public override void OnNavigated()     {         \/\/ TODO Do something here to initialize\/update your page.     }     public override void OnNavigating(ref bool cancel)     {         \/\/ TODO Do something here to clean up your page.     } } <\/code><\/pre>\n<p>  \u0412 XAML \u0432\u044b\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 DataContext \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0434\u043b\u044f \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f.<\/p>\n<pre><code class=\"xml\">&lt;Page x:Class=&quot;YourNamespace.HomePage&quot; ... DataContext=&quot;{Binding HomePageModel}&quot;&gt;     &lt;!-- Your page content goes here --&gt; &lt;\/Page&gt; <\/code><\/pre>\n<p>  \u0412\u0441\u0451, \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442. \u0422\u0435\u043f\u0435\u0440\u044c \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b \u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0438\u0445 c \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u044f\u043c\u0438. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0431\u0443\u0434\u0443\u0442 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u043e\u0431\u044b\u0442\u0438\u044f OnNavigating \u0438 OnNavigated \u0438 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u0435\u0439.<\/p>\n<h5>10. \u0428\u0430\u0431\u043b\u043e\u043d \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043a\u0435\u043b\u0435\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430<\/h5>\n<p>  \u041c\u044b \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b\u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u0430\u0440\u043a\u0430\u0441 \u0434\u043b\u044f \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0428\u0430\u0431\u043b\u043e\u043d \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0432\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0432 Visual Studio \u0438 \u043f\u043e\u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0430\u0445 Windows Store. \u0422\u0430\u043a\u0436\u0435 \u0448\u0430\u0431\u043b\u043e\u043d \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 \u043e\u043d\u043b\u0430\u0439\u043d \u0448\u0430\u0431\u043b\u043e\u043d\u043e\u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u0432 Visual Studio.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/942\/74c\/b4b\/94274cb4b3685b20fbc30d7ee9b1e398.png\"\/> <\/p>\n<h5>\u041f\u043e\u043a\u0430 \u0432\u0441\u0451<\/h5>\n<p>  \u041d\u0443 \u0432\u043e\u0442, \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u044d\u0442\u043e\u0433\u043e \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435 \u0431\u044b\u043b\u0438 \u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u044b \u0445\u043e\u0442\u044c \u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e, \u043d\u043e \u043d\u0435 \u0432\u0441\u0435 \u0444\u0438\u0447\u0438 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438. \u0415\u0441\u0442\u044c \u0435\u0449\u0451 \u043a\u043e\u043d\u0432\u0435\u0440\u0442\u0435\u0440\u044b, \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f, \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a \u0434\u043b\u044f charm-\u043f\u0430\u043d\u0435\u043b\u0438. \u041e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u0445\u0430\u0431\u0440\u0430\u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u0441\u043c\u043e\u0433\u0443\u0442 \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u0437\u043d\u0430\u0442\u044c, \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0432 \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0435\u043a\u0442. \u0422\u0430\u043a \u0447\u0442\u043e \u043f\u043b\u0430\u0432\u043d\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u043f\u0443\u043d\u043a\u0442\u0443:<\/p>\n<h5>\u0413\u0434\u0435 \u043c\u043e\u0436\u043d\u043e \u0441\u043a\u0430\u0447\u0430\u0442\u044c?<\/h5>\n<p>  \u0417\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0445\u0430\u0431\u0440\u0430\u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0438 \u0437\u0430\u0445\u043e\u0442\u044f\u0442 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u0443\u044e \u0431\u0438\u0431\u0438\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438. \u0421\u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e. \u041d\u0430\u0448\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430 \u0434\u043b\u044f \u0441\u043a\u0430\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u0432 \u0432\u0438\u0434\u0435 <a href=\"https:\/\/nuget.org\/packages\/w8mvvm\">Nuget Package<\/a>. \u0422\u0430\u043a\u0436\u0435 \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0437\u0430\u0432\u0435\u0434\u0451\u043d \u043d\u0430 <a href=\"http:\/\/w8mvvm.codeplex.com\/\">CodePlex<\/a>.<\/p>\n<p>  \u0421\u0430\u043c\u044b\u0439 \u0431\u044b\u0441\u0442\u0440\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0435\u0451 \u0432 \u0441\u0442\u0443\u0434\u0438\u044e \u2014 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0438\u0441\u043a\u043e\u043c \u0432 12 \u0441\u0442\u0443\u0434\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 Tools-&gt; Extensions and Updates. \u0412\u044b\u0431\u0435\u0440\u0438\u0442\u0435 Online \u0438 \u0432 \u043f\u043e\u0438\u0441\u043a\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043d\u0430\u0431\u0435\u0440\u0438\u0442\u0435 \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u0435 \u0441\u043b\u043e\u0432\u0430 <b>Windows 8 MVVM<\/b>.<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/6cb\/807\/b79\/6cb807b790557ff9b3a564c43d98abe4.png\"\/> <\/p>\n<h5>\u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a<\/h5>\n<p>  \u00ab\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 EBT.Mvvm \u0440\u0430\u0441\u043f\u0440\u043e\u0441\u0442\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043f\u0440\u0438\u043d\u0446\u0438\u043f\u0443 \u00ab\u043a\u0430\u043a \u0435\u0441\u0442\u044c\u00bb, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043d\u0435 \u043d\u0435\u0441\u0435\u0442 \u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0437\u0430 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u0441\u0442\u0432\u0438\u044f\u2026\u00bb<\/p>\n<p>  \u0410 \u0435\u0441\u043b\u0438 \u0441\u0435\u0440\u044c\u0451\u0437\u043d\u043e, \u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0434\u044b, \u0435\u0441\u043b\u0438 \u043d\u0430\u0448\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u043f\u043e\u0434 \u043c\u043e\u043b\u043e\u0434\u0443\u044e \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0443 Windows 8 \u0441\u044d\u043a\u043e\u043d\u043e\u043c\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043f\u0440\u0435\u043e\u0434\u043e\u043b\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0431\u043b\u0435\u043c, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043f\u0440\u0438\u0448\u043b\u043e\u0441\u044c \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u0442\u044c\u0441\u044f \u043d\u0430\u043c \u0441\u0430\u043c\u0438\u043c. \u041f\u043e \u043c\u0435\u0440\u0435 \u0441\u0438\u043b \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043c\u044b \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u043e \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0438 \u0443\u043b\u0443\u0447\u0448\u0430\u0435\u043c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u0412\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043c\u0435\u0447\u0430\u043d\u0438\u044f \u043c\u043e\u0433\u0443\u0442 \u043d\u0430\u043c \u0432 \u044d\u0442\u043e\u043c \u043f\u043e\u043c\u043e\u0447\u044c.<\/p>\n<p>  \u0425\u043e\u0447\u0435\u0442\u0441\u044f \u043f\u043e\u0436\u0435\u043b\u0430\u0442\u044c \u0432\u0441\u0435\u043c \u0445\u0430\u0431\u0440\u0430\u0447\u0438\u0442\u0430\u0442\u0435\u043b\u044f\u043c, \u0437\u0430\u043d\u0438\u043c\u0430\u044e\u0449\u0438\u043c\u0441\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u043e\u0439, \u0443\u0434\u0430\u0447\u0438. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u043b\u044f Windows Store \u043f\u043e\u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439!    \t \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\/company\/eastbanctech\/blog\/172839\/\"> http:\/\/habrahabr.ru\/company\/eastbanctech\/blog\/172839\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u043d\u0430\u0447\u0430\u043b\u0438 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043d\u0430\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u0434 Windows 8, \u043c\u044b \u0438\u0441\u043a\u0430\u043b\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0448\u0430\u0431\u043b\u043e\u043d\u0430 Model-View-ViewModel (MVVM) \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0432\u0435\u043b\u0438 \u0432 \u0438\u043d\u0442\u0435\u0440\u043d\u0435\u0442\u0435 \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u0442\u0430\u043a\u043e\u0432\u043e\u0439, \u043d\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u0440\u0438\u043d\u044f\u043b\u0438 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0442\u0430\u043a\u0438\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u0432 \u043f\u0440\u0438\u0440\u043e\u0434\u0435 \u043f\u043e\u043a\u0430 \u043d\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 (\u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043c\u044b \u043f\u043b\u043e\u0445\u043e \u0438\u0441\u043a\u0430\u043b\u0438, \u043d\u043e \u0442\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e \u0443\u0436\u0435 \u043d\u0435 \u0442\u0430\u043a \u0432\u0430\u0436\u043d\u043e). \u041e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0432\u043e\u043f\u0440\u043e\u0441 \u00ab\u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c?\u00bb \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u043b\u0441\u044f \u0441\u0430\u043c\u2026<\/p>\n<p>  <img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/389\/7be\/3b1\/3897be3b10a424079983122ab8e2449b.png\"\/><\/p>\n<p>  \u0412 \u043d\u0435\u0434\u0440\u0430\u0445 \u043d\u0430\u0448\u0435\u0439 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 EastBanc Technologies \u0431\u044b\u043b\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0430 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 (\u043a\u043e\u0434\u043e\u0432\u043e\u0435 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 <b>EBT.Mvvm<\/b>). \u0426\u0435\u043b\u044c \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u2014 \u044d\u043a\u043e\u043d\u043e\u043c\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432 \u0431\u0443\u0434\u0443\u0449\u0435\u043c \u043f\u0440\u0438 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f Windows 8. \u0412 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0432\u043e\u0448\u043b\u0438 \u043a\u0430\u043a \u043d\u0430\u0448\u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0435 \u043d\u0430\u0440\u0430\u0431\u043e\u0442\u043a\u0438, \u0442\u0430\u043a \u0438 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0434\u0435\u0438 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u0441\u0442\u0440\u0435\u0447\u0430\u043b\u0438\u0441\u044c \u043d\u0430\u043c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0430\u0448\u0438\u0445 \u043f\u043e\u0438\u0441\u043a\u043e\u0432.<\/p>\n<p>  \u0418\u0442\u0430\u043a, \u0447\u0442\u043e \u043c\u044b \u0438\u043c\u0435\u0435\u043c: \u0432\u0441\u0435 \u043f\u043e\u043c\u043d\u044f\u0442, \u0447\u0442\u043e \u043e\u0441\u043d\u043e\u0432\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0448\u0430\u0431\u043b\u043e\u043d\u0430 \u2014 \u044d\u0442\u043e \u043e\u0441\u043b\u0430\u0431\u043b\u0435\u043d\u0438\u0435 \u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 ViewModel (\u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u0432\u044c\u044e-\u043c\u043e\u0434\u0435\u043b\u044c) \u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e View (\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435). \u0418\u0434\u0435\u0430\u043b\u044c\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u2014 \u044d\u0442\u043e \u043a\u043e\u0433\u0434\u0430 code-behind \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0441 InitializeComponent \u0438, \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u043a\u043e\u0434 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u043d\u0435\u043b\u044c\u0437\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0447\u0435\u0440\u0435\u0437 XAML. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a \u043e\u0442\u0434\u0430\u0435\u0442 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0438\u0437\u0430\u0439\u043d\u0435\u0440\u0443, \u0430 \u0441\u0430\u043c \u0441\u043e\u0441\u0440\u0435\u0434\u043e\u0442\u0430\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0435 \u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p>  \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432, \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0445 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043d\u0430 C# \u0438 XAML \u043f\u043e\u0434 Windows 8. \u041d\u0438\u0436\u0435 \u043c\u044b \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0438\u0447 \u043d\u0430\u0448\u0435\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u0438\u043c\u0435\u0440\u043e\u0432 \u043a\u043e\u0434\u0430 \u0438\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0435\u0432. \u0418\u0442\u0430\u043a, \u043f\u043e\u0435\u0445\u0430\u043b\u0438:<\/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-172839","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/172839","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=172839"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/172839\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=172839"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=172839"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=172839"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}