{"id":315026,"date":"2020-12-17T09:01:36","date_gmt":"2020-12-17T09:01:36","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=315026"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=315026","title":{"rendered":"\u0418\u0437\u0431\u0430\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u043e\u0442 \u00ab\u043c\u0438\u0441\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445\u00bb \u0441\u0442\u0440\u043e\u043a \u0432 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u043d\u0430 Unity"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u041b\u044e\u0431\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043e\u0431\u0440\u0435\u0447\u0435\u043d\u0430 \u043d\u0430 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u044e. \u0422\u0430\u043a \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438 \u0441 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/habr.com\/ru\/company\/pixonic\/blog\/524736\/\">reactive bindings<\/a>.<\/p>\n<p>  \u0427\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430? \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u0440\u0435\u0444\u0430\u0431\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u043a\u043e\u0434\u0435. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c ViewModel, \u043b\u0435\u0436\u0430\u0449\u0430\u044f \u043d\u0430 \u043f\u0440\u0435\u0444\u0430\u0431\u0435. \u0412 \u043d\u0435\u0439 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u0438\u0435 \u043a\u043b\u044e\u0447\u0438 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0441\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443 \u043d\u0430\u0441 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u0430 \u043a UI, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u0430 \u043a \u044d\u0442\u0438\u043c \u043a\u043b\u044e\u0447\u0430\u043c \u0438 \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u0430\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043c\u0435\u043d\u044f\u044f \u0435\u0435 \u0432 \u043a\u043e\u0434\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u0435\u043d\u044f\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f UI \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6f\/lg\/xp\/6flgxpqejnsv77codwmekoktsk0.png\"><\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 reactive bindings \u043f\u0440\u0438\u043d\u0435\u0441\u043b\u043e \u043d\u0430\u043c \u043a\u0430\u043a \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0442\u0430\u043a \u0438 \u0440\u044f\u0434 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0414\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u0434\u0430 \u0438 ViewModel, \u043b\u0435\u0436\u0430\u0449\u0435\u0439 \u043d\u0430 \u043f\u0440\u0435\u0444\u0430\u0431\u0435, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u0438\u043c\u0435\u043d. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0435\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0439 \u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0440\u0435\u0444\u0430\u0431\u0430 \u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u0435\u0440\u0434\u0436\u0430 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b\u0442\u044c \u0443\u0442\u0435\u0440\u044f\u043d\u044b \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u0432\u044f\u0437\u0435\u0439, \u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u043b\u0430\u0441\u044c \u0443\u0436\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043e\u0437\u0434\u043d\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0442\u0432\u0430\u043b\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f UI-\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.<\/p>\n<p>  \u0420\u043e\u0441\u043b\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u2014 \u0440\u043e\u0441\u043b\u043e \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. <\/p>\n<p>  \u0414\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c:<\/p>\n<ul>\n<li>\u0421\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0432 \u043a\u043e\u0434\u0435;<\/li>\n<li>\u041d\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u0432 \u043a\u043e\u0434\u0435 \u0438 \u043a\u043b\u044e\u0447\u0435\u0439 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438.<\/li>\n<\/ul>\n<p>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0437\u0430\u043a\u0440\u044b\u043b\u0438 \u044d\u0442\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u0438.<br \/>  <a name=\"habracut\"><\/a><br \/>  \u041d\u043e \u043e\u0431\u043e \u0432\u0441\u0435\u043c \u043f\u043e \u043f\u043e\u0440\u044f\u0434\u043a\u0443.<\/p>\n<p>  \u0412 \u043d\u0430\u0448\u0438\u0445 <a href=\"https:\/\/habr.com\/ru\/company\/pixonic\/blog\/524736\/\">reactive bindings<\/a> \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u043e\u043b\u044f\u043c \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u0441\u0432\u044f\u0437\u043a\u0435 \u00ab\u0442\u0438\u043f \u043f\u043e\u043b\u044f-\u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0439 \u043f\u0443\u0442\u044c\u00bb \u0432\u043e ViewModel. \u041e\u0442\u0441\u044e\u0434\u0430 \u043f\u043e\u0432\u0441\u0435\u043c\u0435\u0441\u0442\u043d\u043e \u043c\u044b \u0438\u043c\u0435\u043b\u0438 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u043a\u043e\u0434:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public static class AbilitiesPresenter {   private static readonly PropertyName MechAbilities = &quot;mech\/abilities&quot;;   private static readonly PropertyName MechAbilitiesIcon = &quot;mech\/abilities\/icon&quot;;   private static readonly PropertyName MechAbilitiesName = &quot;mech\/abilities\/name&quot;;   private static readonly PropertyName MechAbilitiesDescription = &quot;mech\/abilities\/description&quot;;    public static void Present(IViewModel viewModel, List&lt;AbilityInfo&gt; data)   {      var collection = viewModel.GetMutableCollection(MechAbilities);      collection.Fill(data, SetupAbilityItem);   }    private static void SetupAbilityItem(AbilityInfo data, IViewModel model)   {      model.GetString(MechAbilitiesIcon).Value = data.Icon;      model.GetString(MechAbilitiesName).Value = data.Name;      model.GetString(MechAbilitiesDescription).Value = data.Desc;   } }  <\/code><\/pre>\n<\/div><\/div>\n<p>  \u0422\u043e \u0435\u0441\u0442\u044c, \u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u043e\u043c GetString\/GetInteger\/GetBoolean \u0438 \u0442. \u0434. \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043f\u043e\u043b\u0435 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438 \u043f\u0438\u0448\u0435\u043c\/\u0447\u0438\u0442\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f. <\/p>\n<p>  \u0412 \u0447\u0435\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u044d\u0442\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b? \u0410 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e \u0447\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u0435\u0439 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u2014 \u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435 \u00ab\u0441\u0442\u0440\u043e\u043a\u00bb \u0432 \u043a\u043e\u0434\u0435. \u0427\u0438\u0442\u0430\u0442\u044c \u0438 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0439 \u0441\u0442\u0438\u043b\u044c \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0432\u0435\u0441\u044c\u043c\u0430 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u0442\u0438\u0447\u043d\u043e. <\/p>\n<p>  \u041a\u043e\u043d\u0442\u0440\u043e\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0442\u0438\u043f\u043e\u0432\/\u043f\u0443\u0442\u0435\u0439 \u0432 \u043a\u043e\u0434\u0435 \u0438 \u0432 \u0440\u0435\u0430\u043b\u044c\u043d\u043e\u0439 ViewModel \u2014 \u0442\u0430 \u0435\u0449\u0435 \u0431\u043e\u043b\u044c. \u0415\u0441\u043b\u0438 c UI-\u043f\u0440\u0435\u0444\u0430\u0431\u043e\u043c \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0447\u0435\u043b\u043e\u0432\u0435\u043a\u0430, \u043c\u043e\u0436\u0435\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u043d\u0435\u044f\u0432\u043d\u044b\u0439 \u043c\u0435\u0440\u0434\u0436, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u043a\u043b\u044e\u0447\u0438 \u043c\u043e\u0433\u0443\u0442 \u00ab\u043f\u043e\u0442\u0435\u0440\u044f\u0442\u044c\u0441\u044f\u00bb. \u041e\u0431 \u044d\u0442\u043e\u043c \u043c\u044b \u0443\u0437\u043d\u0430\u0435\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043e\u0437\u0434\u043d\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432, \u043a\u043e\u0433\u0434\u0430 UI \u043f\u0435\u0440\u0435\u0441\u0442\u0430\u0435\u0442 \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u043e\u0440\u0440\u0435\u043a\u0442\u043d\u043e.<\/p>\n<p>  \u0417\u0430\u0434\u0430\u0447\u0430 \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u043b\u0430\u0441\u044c \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0441\u0438\u0441\u0442\u0435\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443\u0431\u0435\u0440\u0435\u0442 \u0438\u0437 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0434\u0430 \u043d\u0435\u043d\u0443\u0436\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u044f\u0432\u043d\u044b\u0439 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f.<\/p>\n<p>  \u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u043e\u0434\u0437\u0430\u0434\u0430\u0447\u0435\u0439 \u044f\u0432\u043b\u044f\u043b\u043e\u0441\u044c \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0447\u0442\u043e\u0431\u044b \u043c\u044b \u043c\u043e\u0433\u043b\u0438 \u0431\u044b\u0442\u044c \u043d\u0430 100% \u0443\u0432\u0435\u0440\u0435\u043d\u044b, \u0447\u0442\u043e \u0442\u0435\u043a\u0443\u0449\u0430\u044f ViewModel \u043d\u0430 \u043f\u0440\u0435\u0444\u0430\u0431\u0435 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u0435\u043a\u0443\u0449\u0435\u043c\u0443 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0443 \u0438 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0432\u0441\u0435 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u043f\u043e\u043b\u044f.<\/p>\n<p>  \u0416\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u043b \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<ul>\n<li>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 ViewModel \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043a\u0438\u0439 \u00ab\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u00bb, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432\u0441\u0435 \u043f\u043e\u043b\u044f \u0438 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u0441\u0432\u044f\u0437\u0438;<\/li>\n<li>\u0414\u0430\u043b\u0435\u0435 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u043d\u0435\u043a\u0438\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430;<\/li>\n<li>\u0412 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0432\u043e ViewModel \u043c\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u043c\u0435\u0442\u044c \u044f\u0432\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f \u043e\u0431 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u043f\u0440\u0438 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0438 \u043a\u0430\u043a\u0438\u0445-\u0442\u043e \u043f\u043e\u043b\u0435\u0439 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438 \u0438\u043b\u0438 \u0432\u043e \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438.<\/li>\n<\/ul>\n<p>  \u0412 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0435\u0441\u0442\u044c \u043e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c \u0434\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0438 \u0432\u044b\u0432\u043e\u0434\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043e\u0448\u0438\u0431\u043a\u0430\u0445 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u2014 \u043c\u043e\u0434\u0443\u043b\u044c <a href=\"https:\/\/habr.com\/ru\/company\/pixonic\/blog\/491324\/\">Validate<\/a>. \u0418 \u0435\u0441\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e (T4). \u0412\u0441\u0435 \u044d\u0442\u043e \u043c\u044b \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u0440\u0435\u0448\u0438\u0442\u044c \u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0434\u0430\u0447\u0443.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0431\u043b\u0438\u0436\u0435 \u043a \u043a\u043e\u0434\u0443.<\/p>\n<p>  \u0420\u0430\u043d\u044c\u0448\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u0443 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0441\u0442\u0438\u043b\u0435:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public static class AbilitiesPresenter {   private static readonly PropertyName MechAbilities = &quot;mech\/abilities&quot;;   private static readonly PropertyName MechAbilitiesIcon = &quot;mech\/abilities\/icon&quot;;   private static readonly PropertyName MechAbilitiesName = &quot;mech\/abilities\/name&quot;;   private static readonly PropertyName MechAbilitiesDescription = &quot;mech\/abilities\/description&quot;;    public static void Present(IViewModel viewModel, List&lt;AbilityInfo&gt; data)   {      var collection = viewModel.GetMutableCollection(MechAbilities);      collection.Fill(data, SetupAbilityItem);   }    private static void SetupAbilityItem(AbilityInfo data, IViewModel model)   {      model.GetString(MechAbilitiesIcon).Value = data.Icon;      model.GetString(MechAbilitiesName).Value = data.Name;      model.GetString(MechAbilitiesDescription).Value = data.Desc;   } } <\/code><\/pre>\n<\/div><\/div>\n<p>  \u0417\u0434\u0435\u0441\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c, \u0447\u0442\u043e \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440 \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u0435\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0441\u043e \u0441\u0432\u043e\u0435\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u043f\u043e\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0443\u0436\u043d\u044b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u0434\u043b\u044f \u0435\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0438. \u0418 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u043e\u0441\u0442\u0438 ViewModel \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u043b\u0435\u0439 \u0443 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043f\u0440\u0435\u0437\u0435\u043d\u0442\u0435\u0440\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442 \u0434\u0430\u043d\u043d\u0443\u044e ViewModel, \u0430 \u044d\u0442\u043e \u0442\u0430 \u0435\u0449\u0435 \u0437\u0430\u0434\u0430\u0447\u043a\u0430.<\/p>\n<p>  \u0421\u0442\u0430\u043b\u043e \u0436\u0435 \u0432\u0441\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">namespace DroneDetails {   public class DroneDetailScreenView : UIScreenViewWith3D&lt;DroneViewUI3DScreen&gt;   {      [ExpectReactiveContract(typeof(DroneInfoViewModel))] [ExpectNotNull] [SerializeField]      private ViewModel _droneInfoModel;       [ExpectReactiveContract(typeof(DroneScreenMainEventsModel))] [ExpectNotNull] [SerializeField]      private ViewModel _droneScreenMainEventsModel;       [ExpectReactiveContract(typeof(DroneScreenInfoModel))] [ExpectNotNull] [SerializeField]      private ViewModel _droneScreenInfoModel;       [ExpectReactiveContract(typeof(DroneSpawnInfoViewModel))] [ExpectNotNull] [SerializeField]      private ViewModel _droneSpawnInfoViewModel;       [ExpectReactiveContract(typeof(ScrollListViewModel))] [ExpectNotNull] [SerializeField]      private ViewModel _scrollListViewModel; \/\/\u2026.    } } <\/code><\/pre>\n<\/div><\/div>\n<p>  ViewModel \u043f\u0440\u0438\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0442\u0440\u0438\u0431\u0443\u0442 ExpectReactiveContract, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430. \u041f\u0440\u0438\u043c\u0435\u0440 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">public struct ConnectionStatusViewModel : IBindViewModel { \/\/\u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439   [Bind(&quot;connection\/is-lost&quot;)]   public IMutableProperty&lt;string&gt;IsConnectionLost;   [Bind(&quot;mech\/slots-count&quot;)]    public IMutableProperty&lt;int&gt; SlotsCount;  \/\/\u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u043b\u043e\u0436\u0435\u043d\u043d\u043e\u0439 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438   [Bind(&quot;current-drone-info\/scheme-slots-info&quot;)]      [SchemaContract(typeof(SchemeSlotInfoViewModel))]   public IMutableCollection SchemeSlotsInfo; } <\/code><\/pre>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u0435 \u0435\u0441\u0442\u044c \u044f\u0432\u043d\u043e\u0435 \u0442\u0438\u043f\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0435 \u043f\u043e\u043b\u0435. \u0421\u0432\u0435\u0440\u0445\u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u043c Bind \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0441\u0442\u0440\u043e\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0435\u0442 \u044d\u0442\u043e \u043f\u043e\u043b\u0435 \u0441 ViewModel. <\/p>\n<pre><code class=\"cs\">private void OnPreviewDrone(int index) {   _droneDetailModel.DroneScrollStateModel.SaveState(index);   var droneId = _dronesListModel.GetDroneIdByIndex(index);   _view.DroneInfoViewModel.DroneId.Value = droneId;   \/\/... } <\/code><\/pre>\n<p>  \u0421\u043f\u043e\u0441\u043e\u0431 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0442\u0435\u043f\u0435\u0440\u044c \u0441\u0442\u0430\u043b \u043a\u0430\u043d\u043e\u043d\u0438\u0447\u043d\u044b\u043c: \u043c\u044b \u0431\u0435\u0440\u0435\u043c \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 (\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442) \u0438 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u043d\u043e\u0432\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u043c\u0443 \u0438\u0437 \u043f\u043e\u043b\u0435\u0439 (\u0432 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u044d\u0442\u043e DroneId).<\/p>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u043a\u043e\u0434\u0435 \u0443 \u043d\u0430\u0441 \u043d\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u043b\u0438\u0448\u043d\u0438\u0445 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442, \u043d\u0435\u0442 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043b\u043e\u0433\u0438\u043a\u0438 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u043f\u043e\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b \u0441\u043c\u0443\u0449\u0430\u043b\u0430 \u043f\u0440\u0438 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0438. \u041e\u043d \u0441\u0442\u0430\u043b \u043d\u0430\u043c\u043d\u043e\u0433\u043e \u0447\u0438\u0449\u0435, \u0432\u0435\u0434\u044c \u043c\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441 \u043e\u0431\u044b\u0447\u043d\u044b\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u043c\u0438. \u0412\u0441\u0435 \u044d\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043e\u0432\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0441\u0430\u043c \u0437\u043d\u0430\u0435\u0442, \u043a\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0438\u0437 \u0442\u043e\u0439 ViewModel, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u044b\u043b\u0430 \u0435\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u0430, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044f \u0438, \u043f\u0440\u0438\u0432\u044f\u0437\u044b\u0432\u0430\u044f\u0441\u044c \u043a \u043d\u0435\u0439, \u043f\u043e\u043f\u0443\u0442\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e.<\/p>\n<p>  \u0414\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430: Bind \u0438 SchemaContract. Bind \u043e\u0442\u0432\u0435\u0447\u0430\u0435\u0442 \u0437\u0430 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0441 \u043f\u043e\u043b\u0435\u043c \u0432\u043e ViewModel. \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u043a\u043b\u044e\u0447 \u0438 \u043e\u043f\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e\u043b\u0435 IsRequired, \u0433\u043e\u0432\u043e\u0440\u044f\u0449\u0435\u0435 \u043e \u0442\u043e\u043c, \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043b\u0438 \u0432\u043e ViewModel \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0439 \u043a\u043b\u044e\u0447 \u0438\u043b\u0438 \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442, \u0435\u0441\u043b\u0438 \u0435\u0433\u043e \u0443\u043f\u0443\u0441\u0442\u0438\u0442\u044c. <\/p>\n<p>  \u041f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 Bind \u043c\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u044d\u0442\u043e\u0442 \u0430\u0442\u0440\u0438\u0431\u0443\u0442 \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0432 \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440:<\/p>\n<pre><code class=\"cs\">[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field |                AttributeTargets.GenericParameter)] public class BindAttribute : Attribute {   public string ViewModelPath { get; }   public bool IsRequired { get; }    public BindAttribute(string value, bool isRequired = true)   {      ViewModelPath = value;      IsRequired = isRequired;   } } <\/code><\/pre>\n<p>  \u0410\u0442\u0440\u0438\u0431\u0443\u0442 SchemaContract \u0441\u043b\u0443\u0436\u0438\u0442 \u0441 \u0446\u0435\u043b\u044c\u044e \u0443\u043a\u0430\u0437\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0434\u043b\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u0438:<\/p>\n<pre><code class=\"cs\">[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field |   AttributeTargets.GenericParameter)] public class SchemaContractAttribute : Attribute {   public System.Type[] BindViewModelContracts;    public SchemaContractAttribute(params System.Type[]contracts)   {      BindViewModelContracts = contracts;   } } <\/code><\/pre>\n<p>  \u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442. \u0414\u0435\u043b\u043e \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0437\u0430 \u043c\u0430\u043b\u044b\u043c: \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0435\u0433\u043e \u043f\u043e\u043b\u043d\u043e\u0446\u0435\u043d\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043a\u0430\u043a-\u0442\u043e \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432\u0441\u0435\u0445 \u043f\u043e\u043b\u0435\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043a\u043b\u0430\u0441\u0441 \u2014 \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440.<\/p>\n<p>  \u0420\u0435\u0437\u043e\u043b\u0432\u0435\u0440 \u2014 \u043a\u043b\u0430\u0441\u0441, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u043e\u0436\u0435\u0442 \u043f\u0440\u043e\u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u043b\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b (\u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430). \u041e\u043d \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0440\u043e\u043b\u044c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0436\u0434\u0443 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u043e\u043c \u0438 ViewModel \u043d\u0430 \u043f\u0440\u0435\u0444\u0430\u0431\u0435. <\/p>\n<p>  \u0420\u0435\u0437\u043e\u043b\u0432\u0435\u0440\u044b \u0438\u043c\u0435\u044e\u0442 \u043f\u0440\u043e\u0441\u0442\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u044f\u0442 \u0434\u043b\u044f \u043a\u043e\u0434\u043e\u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">\/\/ ------------------------------------------------------------------------------ \/\/ &lt;auto-generated&gt; \/\/     This code was generated by ViewModelBindingsGenerator \/\/     Changes to this file may cause incorrect behavior and will be lost if \/\/     the code is regenerated. \/\/ &lt;\/auto-generated&gt; \/\/ ------------------------------------------------------------------------------  using PS.ReactiveBindings; using Test;  namespace BindViewModel {    public partial struct BindViewModelResolver    {        private static ConnectionStatusViewModel ResolveConnectionStatusViewModel(IViewModel viewModel)            =&gt; new ConnectionStatusViewModel            {                IsConnectionLost = LookupProperty&lt;IMutableProperty&lt;string&gt;&gt;(                &quot;ConnectionStatusViewModel&quot;,                viewModel,                 PropertyType.String,                 &quot;connection\/is-lost&quot;,                 true),                 SomeCollection = LookupProperty&lt;IMutableCollection&gt;(                &quot;ConnectionStatusViewModel&quot;,        viewModel,                 PropertyType.Collection,                 &quot;mech\/tempCollection&quot;,                 true),            };    } } <\/code><\/pre>\n<\/div><\/div>\n<p>  \u0422\u0435\u043c\u043f\u043b\u0435\u0439\u0442 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">&lt;#@ template debug=&quot;false&quot; hostspecific=&quot;false&quot; language=&quot;C#&quot; #&gt; &lt;#@ parameter name =&quot;m_GenerationInfo&quot; type=&quot;WarRobots.RBViewModelWrapperGenerator.BindViewModel.GenerationInfo&quot;#&gt;  \/\/ ------------------------------------------------------------------------------ \/\/ &lt;auto-generated&gt; \/\/     This code was generated by ViewModelBindingsGenerator \/\/     Changes to this file may cause incorrect behavior and will be lost if \/\/     the code is regenerated. \/\/ &lt;\/auto-generated&gt; \/\/ ------------------------------------------------------------------------------  using PS.ReactiveBindings; using &lt;#=m_GenerationInfo.Namespace #&gt;;  namespace BindViewModel {    public partial struct BindViewModelResolver    {        private static &lt;#=m_GenerationInfo.ClassName #&gt; Resolve&lt;#=m_GenerationInfo.ClassName #&gt;(IViewModel viewModel)            =&gt; new &lt;#=m_GenerationInfo.ClassName #&gt;            { &lt;#   foreach (var property in m_GenerationInfo.PropertiesInfo)   {      var requiredString = property.Required.ToString().ToLower(); #&gt;                &lt;#=property.Name #&gt; = LookupProperty&lt;&lt;#=property.PropertyTypeName #&gt;&gt;(&quot;&lt;#=m_GenerationInfo.ClassName #&gt;&quot;,viewModel, &lt;#=property.ReactivePropertyTypeName #&gt;, &quot;&lt;#=property.ViewModelPath #&gt;&quot;, &lt;#=requiredString #&gt;), &lt;#   } #&gt;            };    } }<\/code><\/pre>\n<\/div><\/div>\n<p>  \u041a\u043b\u0430\u0441\u0441 BindViewModelResolver \u2014 partial \u0438 \u0438\u043c\u0435\u0435\u0442 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u0443\u044e \u0447\u0430\u0441\u0442\u044c. \u0417\u0430\u0434\u0430\u0447\u0430 \u043c\u0435\u0442\u043e\u0434\u0430 resolve \u2014 \u043d\u0430\u0439\u0442\u0438 \u043d\u0443\u0436\u043d\u044b\u0439 \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440 \u0434\u043b\u044f \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u0430 \u0438 \u0441 \u0435\u0433\u043e \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0438 \u043f\u0440\u0435\u0444\u0430\u0431\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e. <\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435 \u0435\u0441\u0442\u044c \u043c\u0435\u0442\u043e\u0434 ResolveWithReflection (fallback), \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0434\u0430\u043d\u043d\u043e\u0435 \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044e. \u042d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u043d\u043e \u043d\u0430 \u0441\u043b\u0443\u0447\u0430\u0439, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440. \u0420\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043c\u0435\u0434\u043b\u0435\u043d\u043d\u0435\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u0442\u0430\u0440\u0430\u0435\u043c\u0441\u044f \u0435\u0435 \u0438\u0437\u0431\u0435\u0433\u0430\u0442\u044c.<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public partial struct BindViewModelResolver {   private static Dictionary&lt;System.Type, IResolver&gt; _resolvers;   static partial void InitResolvers();    public static T Resolve&lt;T&gt;(IViewModel viewModel) where T : struct, IBindViewModel   {      InitResolvers();      if (_resolvers != null &amp;&amp; _resolvers.ContainsKey(typeof(T)))      {         var resolver = (Resolver&lt;T&gt;) _resolvers[typeof(T)];         return resolver.Resolve(viewModel);      }       return ResolveWithReflection&lt;T&gt;(viewModel);   }    private class CanNotResolvePropertyException : System.Exception   {      public CanNotResolvePropertyException(string message) : base(message)      {      }   }    private interface IResolver   {   }    private struct Resolver&lt;T&gt; : IResolver      where T : struct, IBindViewModel   {      public delegate T ResolveDelegate(IViewModel viewModel);       public ResolveDelegate Resolve;   }    private static Resolver&lt;T&gt; FromDelegate&lt;T&gt;(Resolver&lt;T&gt;.ResolveDelegate resolveDelegate)      where T : struct, IBindViewModel      =&gt; new Resolver&lt;T&gt; {Resolve = resolveDelegate};    private static T LookupProperty&lt;T&gt;(      string holderName,      IViewModel viewModel,      PropertyType type,      PropertyName id,      bool required)      where T : class, IReactive   {      T obj = viewModel.LookupProperty(id, type) as T;      if (obj == null)      {         if (required)         {            throw new CanNotResolvePropertyException(               $&quot;{holderName} -&gt; Can't resolve {id} path =&gt; \\n PropertyType.{type} \\n {id}&quot;            );         }          Debug.LogWarning($&quot;{holderName} -&gt; Can't resolve {id} path =&gt; \\n PropertyType.{type} \\n {id}&quot;);      }       return obj;   }    private static T ResolveWithReflection&lt;T&gt;(IViewModel viewModel)   {      var type = typeof(T);      var fields = type.GetFields();      var resolvedStruct = System.Activator.CreateInstance(type);      foreach (var field in fields)      {         var bindAttribute = field.GetCustomAttribute&lt;BindAttribute&gt;();         if (bindAttribute != null)         {            var viewModelPath = bindAttribute.ViewModelPath;            var result = ResolveFieldValue(type.Name, field.FieldType, viewModelPath, viewModel, bindAttribute.IsRequired);            field.SetValue(resolvedStruct, result);         }      }       return (T) resolvedStruct;   } <\/code><\/pre>\n<\/div><\/div>\n<p>  \u0421\u0430\u043c\u0438 \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440\u044b \u043b\u0435\u0436\u0430\u0442 \u0432 \u0441\u043b\u043e\u0432\u0430\u0440\u0435 \u043f\u043e \u0442\u0438\u043f\u0430\u043c. \u042d\u0442\u043e\u0442 \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440\u043e\u0432 \u0438 \u043e\u043f\u0438\u0441\u0430\u043d \u0432 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438. \u0410 \u0441\u0430\u043c\u0430 \u043e\u043d\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public partial struct BindViewModelResolver {    static partial void InitResolvers()    {         if (_resolvers != null) return;        _resolvers = new Dictionary&lt;System.Type, IResolver&gt;        {            {typeof(DroneInfoViewModel), FromDelegate(ResolveDroneInfoViewModel)},            {typeof(DroneSchemeMetaphorViewModel), FromDelegate(ResolveDroneSchemeMetaphorViewModel)},            {typeof(DroneScreenInfoModel), FromDelegate(ResolveDroneScreenInfoModel)},            {typeof(DroneScreenMainEventsModel), FromDelegate(ResolveDroneScreenMainEventsModel)},            {typeof(DroneSpawnInfoViewModel), FromDelegate(ResolveDroneSpawnInfoViewModel)},            {typeof(DroneStoreItemViewModel), FromDelegate(ResolveDroneStoreItemViewModel)},            {typeof(HangarSlotViewModel), FromDelegate(ResolveHangarSlotViewModel)},            {typeof(SchemeSlotInfoViewModel), FromDelegate(ResolveSchemeSlotInfoViewModel)},            {typeof(ScrollListViewModel), FromDelegate(ResolveScrollListViewModel)},            {typeof(StateItemViewModel), FromDelegate(ResolveStateItemViewModel)},            {typeof(ConnectionStatusViewModel), FromDelegate(ResolveConnectionStatusViewModel)},            {typeof(TitanStateViewModel), FromDelegate(ResolveTitanStateViewModel)},            {typeof(MechStateViewModel), FromDelegate(ResolveMechStateViewModel)},            {typeof(ChipOfferItemViewModel), FromDelegate(ResolveChipOfferItemViewModel)},            {typeof(DroneOfferItemViewModel), FromDelegate(ResolveDroneOfferItemViewModel)},        };    } } <\/code><\/pre>\n<\/div><\/div>\n<p>  \u0422\u0435\u043c\u043f\u043b\u0435\u0439\u0442 \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0447\u0430\u0441\u0442\u0438:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">&lt;#@ template debug=&quot;false&quot; hostspecific=&quot;false&quot; language=&quot;C#&quot; #&gt; &lt;#@ parameter name =&quot;m_GenerationInfos&quot; type=&quot;System.Collections.Generic.List&lt;WarRobots.RBViewModelWrapperGenerator.BindViewModel.GenerationInfo&gt;&quot;#&gt; &lt;#@ import namespace=&quot;System.Collections.Generic&quot; #&gt; &lt;#@ import namespace=&quot;BindViewModel&quot; #&gt;  \/\/ ------------------------------------------------------------------------------ \/\/ &lt;auto-generated&gt; \/\/     This code was generated by ViewModelBindingsGenerator \/\/     Changes to this file may cause incorrect behavior and will be lost if \/\/     the code is regenerated. \/\/ &lt;\/auto-generated&gt; \/\/ ------------------------------------------------------------------------------  using System.Collections.Generic; &lt;# List&lt;string&gt; namespaces = new List&lt;string&gt;();   foreach (var generationInfo in m_GenerationInfos)   {      if (!namespaces.Contains(generationInfo.Namespace))      { #&gt; using &lt;#=generationInfo.Namespace #&gt;; &lt;#         namespaces.Add(generationInfo.Namespace);      }   } #&gt;  namespace BindViewModel {    public partial struct BindViewModelResolver    {        static partial void InitResolvers()        {             if (_resolvers != null) return;            _resolvers = new Dictionary&lt;System.Type, IResolver&gt;            { &lt;#   foreach (var generationInfo in m_GenerationInfos)   { #&gt;                {typeof(&lt;#=generationInfo.ClassName #&gt;), FromDelegate(Resolve&lt;#=generationInfo.ClassName #&gt;)}, &lt;#   } #&gt;            };        }    } } <\/code><\/pre>\n<\/div><\/div>\n<p>  \u0418\u0442\u0430\u043a, \u0442\u0435\u043f\u0435\u0440\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440\u043e\u0432. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u0434\u043b\u044f \u0435\u0433\u043e \u0432\u044b\u0437\u043e\u0432\u0430. \u0410 \u044d\u0442\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430. <\/p>\n<p>  \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043f\u043e assemblies \u0438 \u0432\u044b\u0438\u0441\u043a\u0438\u0432\u0430\u0435\u0442 \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442\u044b-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a\u0438 IBindViewModel. \u041d\u0430\u0439\u0434\u044f \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442, \u043e\u043d \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u043f\u043e \u043d\u0435\u043c\u0443 \u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u0438. \u0422\u0435\u043a\u0443\u0449\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0438\u0437 \u0438\u043c\u0435\u043d\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439, \u0442\u0438\u043f\u0430, \u043f\u0443\u0442\u0438 \u0434\u043b\u044f \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0447\u0435\u0433\u043e. \u0417\u0430\u0442\u0435\u043c \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u0430\u044f \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u0442\u0441\u044f \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0432 T4-\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440.<\/p>\n<p>  \u041a\u043e\u0434 \u0434\u043b\u044f \u0441\u0431\u043e\u0440\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">List&lt;GenerationInfo&gt; generationInfos = new List&lt;GenerationInfo&gt;(); Assembly[] assemblies = AppDomain.CurrentDomain.GetAssemblies(); foreach (var assembly in assemblies) {    var types = assembly.GetTypes();    var iBindViewModelType = typeof(IBindViewModel);   foreach (Type type in types)   {      if (type.IsValueType &amp;&amp; iBindViewModelType.IsAssignableFrom(type))      {         GenerationInfo generationInfo = new GenerationInfo {ClassName = type.Name, Namespace = type.Namespace};         var props = new List&lt;PropertyInfo&gt;();         var fields = type.GetFields();         foreach (var field in fields)         {            var bindAttribute = field.GetCustomAttribute&lt;BindAttribute&gt;();            if (bindAttribute != null)            {               var propertyInfo = new PropertyInfo();               propertyInfo.Name = field.Name;               propertyInfo.ViewModelPath = bindAttribute.ViewModelPath;               var propertyTypeNames = GetPropertyTypeName(field.FieldType);               propertyInfo.ReactivePropertyTypeName = propertyTypeNames.ReactivePropertyTypeName;               propertyInfo.PropertyTypeName = propertyTypeNames.PropertyTypeName;               propertyInfo.ValueTypeName = propertyTypeNames.ValueTypeName;               propertyInfo.Required = bindAttribute.IsRequired;               props.Add(propertyInfo);            }         }          generationInfo.PropertiesInfo = props;         generationInfos.Add(generationInfo);      }   } } <\/code><\/pre>\n<\/div><\/div>\n<p>  \u041f\u0435\u0440\u0435\u0434\u0430\u0447\u0430 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a T4-\u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u0430:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">foreach (var gInfo in generationInfos) {   var viewModelBindingsTemplateGenerator = new ViewModelBindingsTemplate   {      Session = new Dictionary&lt;string, object&gt; {[&quot;_m_GenerationInfoField&quot;] = gInfo}   };   viewModelBindingsTemplateGenerator.Initialize();   var generationData = viewModelBindingsTemplateGenerator.TransformText();   File.WriteAllText(fullOutputPath + gInfo.ClassName + &quot;.cs&quot;, generationData); }  var viewModelResolverTemplateGenerator = new ViewModelResolverTemplate() {   Session = new Dictionary&lt;string, object&gt; {[&quot;_m_GenerationInfosField&quot;] = generationInfos} }; viewModelResolverTemplateGenerator.Initialize(); var generationResult = viewModelResolverTemplateGenerator.TransformText(); File.WriteAllText(fullOutputPath + &quot;BindViewModelResolverGenerated.cs&quot;, generationResult); <\/code><\/pre>\n<\/div><\/div>\n<p>  \u041a\u0430\u043a \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u2014 \u0442\u0435\u043f\u0435\u0440\u044c \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043d\u0442\u0440\u0430\u043a\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">Var DroneInfoViewModel = BindViewModelResolver.Resolve&lt;DroneInfoViewModel&gt;(_droneInfoModel);<\/code><\/pre>\n<p>  \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u0433\u0435\u043d\u0435\u0440\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u0437\u043e\u043b\u0432\u0435\u0440\u0430 \u0434\u043b\u044f DroneInfoViewModel:<\/p>\n<div class=\"spoiler\" role=\"button\" tabindex=\"0\">                         <b class=\"spoiler_title\">\u041f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043a\u043e\u0434<\/b>                         <\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cs\">public partial struct BindViewModelResolver {    private static DroneInfoViewModel ResolveDroneInfoViewModel(IViewModel viewModel)        =&gt; new DroneInfoViewModel        {            OnTopInfoClick = LookupProperty&lt;IEvent&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Event, &quot;current-drone-info\/on-top-info-click&quot;, true),            OnBottomInfoClick = LookupProperty&lt;IEvent&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Event, &quot;current-drone-info\/on-bottom-info-click&quot;, true),            DroneName = LookupProperty&lt;IMutableProperty&lt;string&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.String, &quot;current-drone-info\/drone-name&quot;, true),            DroneTier = LookupProperty&lt;IMutableProperty&lt;string&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.String, &quot;current-drone-info\/drone-tier&quot;, true),            VoltageCurrent = LookupProperty&lt;IMutableProperty&lt;int&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Integer, &quot;current-drone-info\/voltage-current&quot;, true),            VoltageMax = LookupProperty&lt;IMutableProperty&lt;int&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Integer, &quot;current-drone-info\/voltage-max&quot;, true),            VoltageRange = LookupProperty&lt;IMutableProperty&lt;string&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.String, &quot;current-drone-info\/voltage-range&quot;, true),            SpawnChargeCost = LookupProperty&lt;IMutableProperty&lt;int&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Integer, &quot;current-drone-info\/spawn-charge-cost&quot;, true),            SpawnHardCost = LookupProperty&lt;IMutableProperty&lt;int&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Integer, &quot;current-drone-info\/spawn-hard-cost&quot;, true),            BuyCurrency = LookupProperty&lt;IMutableProperty&lt;string&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.String, &quot;current-drone-info\/buy-currency&quot;, true),            BuyPriceValue = LookupProperty&lt;IMutableProperty&lt;int&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Integer, &quot;current-drone-info\/buy-price-value&quot;, true),            SchemeSlotsInfo = LookupProperty&lt;IMutableCollection&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Collection, &quot;current-drone-info\/scheme-slots-info&quot;, true),            DroneId = LookupProperty&lt;IMutableProperty&lt;string&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.String, &quot;current-drone-info\/drone-id&quot;, true),            InLoadingState = LookupProperty&lt;IMutableProperty&lt;bool&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Boolean, &quot;drone-info\/in-loading-state&quot;, true),            DroneExist = LookupProperty&lt;IMutableProperty&lt;bool&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Boolean, &quot;drone-info\/drone-exist&quot;, true),            DroneNoSlot = LookupProperty&lt;IMutableProperty&lt;bool&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Boolean, &quot;drone-info\/drone-no-slot&quot;, true),            DroneNoDrone = LookupProperty&lt;IMutableProperty&lt;bool&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Boolean, &quot;drone-info\/drone-no-drone&quot;, true),            IsDroneBlueprint = LookupProperty&lt;IMutableProperty&lt;bool&gt;&gt;(&quot;DroneInfoViewModel&quot;,viewModel, PropertyType.Boolean, &quot;drone-info\/drone-blueprint&quot;, true),        }; } <\/code><\/pre>\n<\/div><\/div>\n<p>  \u041d\u0430\u043f\u043e\u0441\u043b\u0435\u0434\u043e\u043a \u2014 \u0432 \u043f\u0430\u0440\u0435 \u0441\u043b\u043e\u0432 \u043e \u0432\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440\u0430\u0445.<\/p>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u043c\u043e\u0434\u0435\u043b\u0438, \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 ExpectReactiveContract:<\/p>\n<pre><code class=\"cs\">[ExpectReactiveContract(typeof(DroneInfoViewModel))] private ViewModel _droneInfoModel; <\/code><\/pre>\n<p>  \u041f\u0440\u0438 \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u043e\u0448\u0438\u0431\u043e\u043a \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0432\u0435\u0434\u0435\u043d\u043e \u043f\u0440\u0435\u0434\u0443\u043f\u0440\u0435\u0436\u0434\u0435\u043d\u0438\u0435 \u0432\u0438\u0434\u0430:<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/tc\/xh\/fk\/tcxhfk41o63iza5pfzhfelyfnkq.png\"><\/p>\n<p>  \u0412\u0430\u043b\u0438\u0434\u0430\u0442\u043e\u0440 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0435\u0444\u043b\u0435\u043a\u0441\u0438\u0438, \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u044f \u043f\u043e Bind-\u043f\u043e\u043b\u044f\u043c \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u044f \u0438\u0445 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438.<\/p>\n<p>  \u041d\u0430\u043b\u0438\u0447\u0438\u0435 \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043f\u0440\u0438\u043d\u0435\u0441\u043b\u043e \u043d\u0430\u043c \u0440\u044f\u0434 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432:<\/p>\n<ul>\n<li>\u0443\u043c\u0435\u043d\u044c\u0448\u0438\u043b\u043e\u0441\u044c \u0432\u0440\u0435\u043c\u044f \u0440\u0443\u0447\u043d\u043e\u0433\u043e \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f;<\/li>\n<li>\u043f\u043e\u0438\u0441\u043a \u043e\u0448\u0438\u0431\u043e\u043a \u0441\u0442\u0430\u043b \u043f\u0440\u043e\u0449\u0435;<\/li>\n<li>\u0443\u043f\u0440\u043e\u0441\u0442\u0438\u043b\u0430\u0441\u044c \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0430\u044f \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u043a\u0430\/\u043f\u0435\u0440\u0435\u0440\u0430\u0431\u043e\u0442\u043a\u0430 UI;<\/li>\n<li>\u0441\u0442\u0430\u043b\u043e \u0441\u0442\u0430\u0431\u0438\u043b\u044c\u043d\u0435\u0435 \u0438 \u043b\u0435\u0433\u0447\u0435 \u043f\u0435\u0440\u0435\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043a\u043b\u0430\u0441\u0441\u043e\u0432, \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0449\u0438\u0445 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 UI.<\/li>\n<\/ul>\n<p>  \u041d\u0430 \u0442\u0435\u043a\u0443\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0430\u044f \u0444\u0438\u0447\u0430 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0438 \u0435\u0449\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0442\u0430\u0440\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u043f\u0435\u0440\u0435\u0432\u0435\u0434\u0435\u043d\u043e \u043d\u0430 \u043d\u043e\u0432\u044b\u0435 \u0440\u0435\u043b\u044c\u0441\u044b. \u0414\u0430\u043d\u043d\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442 \u043d\u043e\u0432\u044b\u0439 \u0438 \u0442\u043e\u0447\u043d\u043e \u0435\u0449\u0435 \u043f\u043e\u0434\u0432\u0435\u0440\u0433\u043d\u0435\u0442\u0441\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f\u043c \u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c.<\/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=\"https:\/\/habr.com\/ru\/company\/pixonic\/blog\/533448\/\"> https:\/\/habr.com\/ru\/company\/pixonic\/blog\/533448\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\">\u041b\u044e\u0431\u0430\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0447\u0430\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435, \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u043e\u0431\u0440\u0435\u0447\u0435\u043d\u0430 \u043d\u0430 \u044d\u0432\u043e\u043b\u044e\u0446\u0438\u044e. \u0422\u0430\u043a \u0441\u043b\u0443\u0447\u0438\u043b\u043e\u0441\u044c \u0438 \u0441 \u043d\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u043e\u0439 \u0440\u0435\u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u043d\u0438\u044f <a href=\"https:\/\/habr.com\/ru\/company\/pixonic\/blog\/524736\/\">reactive bindings<\/a>.<\/p>\n<p>  \u0427\u0442\u043e \u044d\u0442\u043e \u0437\u0430 \u0441\u0438\u0441\u0442\u0435\u043c\u0430? \u041e\u043d\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0441\u0432\u044f\u0437\u044b\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u043f\u0440\u0435\u0444\u0430\u0431\u0435 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u043a\u043e\u0434\u0435. \u0423 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c ViewModel, \u043b\u0435\u0436\u0430\u0449\u0430\u044f \u043d\u0430 \u043f\u0440\u0435\u0444\u0430\u0431\u0435. \u0412 \u043d\u0435\u0439 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u0438\u0435 \u043a\u043b\u044e\u0447\u0438 \u0441 \u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0442\u0438\u043f\u0430\u043c\u0438. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0432\u0441\u044f \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u0430\u044f \u043b\u043e\u0433\u0438\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0443 \u043d\u0430\u0441 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u0430 \u043a UI, \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u0430 \u043a \u044d\u0442\u0438\u043c \u043a\u043b\u044e\u0447\u0430\u043c \u0438 \u0438\u0445 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c. \u0422\u043e \u0435\u0441\u0442\u044c, \u0435\u0441\u043b\u0438 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u0430\u044f \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f, \u043c\u0435\u043d\u044f\u044f \u0435\u0435 \u0432 \u043a\u043e\u0434\u0435, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043c\u0435\u043d\u044f\u0442\u044c \u043b\u044e\u0431\u044b\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f UI \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/6f\/lg\/xp\/6flgxpqejnsv77codwmekoktsk0.png\"><\/p>\n<p>  \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 reactive bindings \u043f\u0440\u0438\u043d\u0435\u0441\u043b\u043e \u043d\u0430\u043c \u043a\u0430\u043a \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439, \u0442\u0430\u043a \u0438 \u0440\u044f\u0434 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439. \u0414\u043b\u044f \u0441\u0432\u044f\u0437\u0438 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u0434\u0430 \u0438 ViewModel, \u043b\u0435\u0436\u0430\u0449\u0435\u0439 \u043d\u0430 \u043f\u0440\u0435\u0444\u0430\u0431\u0435, \u043d\u0430\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0431\u044b\u043b\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0435 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0445 \u0438\u043c\u0435\u043d. \u042d\u0442\u043e \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u043b\u043e \u043a \u0442\u043e\u043c\u0443, \u0447\u0442\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043d\u0435\u043e\u0441\u0442\u043e\u0440\u043e\u0436\u043d\u043e\u0439 \u043f\u0440\u0430\u0432\u043a\u0438 \u043f\u0440\u0435\u0444\u0430\u0431\u0430 \u0438\u043b\u0438 \u043e\u0448\u0438\u0431\u043a\u0438 \u043c\u0435\u0440\u0434\u0436\u0430 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b\u0442\u044c \u0443\u0442\u0435\u0440\u044f\u043d\u044b \u043a\u0430\u043a\u0438\u0435-\u0442\u043e \u0438\u0437 \u044d\u0442\u0438\u0445 \u0441\u0432\u044f\u0437\u0435\u0439, \u0430 \u043e\u0448\u0438\u0431\u043a\u0430 \u0437\u0430\u043c\u0435\u0447\u0430\u043b\u0430\u0441\u044c \u0443\u0436\u0435 \u043d\u0430 \u044d\u0442\u0430\u043f\u0435 \u043f\u043e\u0437\u0434\u043d\u0438\u0445 \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u0432\u0438\u0434\u0435 \u043e\u0442\u0432\u0430\u043b\u0438\u0432\u0448\u0435\u0433\u043e\u0441\u044f UI-\u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430.<\/p>\n<p>  \u0420\u043e\u0441\u043b\u0430 \u0447\u0430\u0441\u0442\u043e\u0442\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u2014 \u0440\u043e\u0441\u043b\u043e \u0447\u0438\u0441\u043b\u043e \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439. <\/p>\n<p>  \u0414\u0432\u0430 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u043d\u0435\u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0443\u043b\u0438\u0441\u044c:<\/p>\n<ul>\n<li>\u0421\u0442\u0440\u043e\u043a\u043e\u0432\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 \u0432 \u043a\u043e\u0434\u0435;<\/li>\n<li>\u041d\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u044f \u043a\u043b\u044e\u0447\u0435\u0439 \u0432 \u043a\u043e\u0434\u0435 \u0438 \u043a\u043b\u044e\u0447\u0435\u0439 \u0432 \u043c\u043e\u0434\u0435\u043b\u0438.<\/li>\n<\/ul>\n<p>  \u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u043e \u0442\u043e\u043c, \u043a\u0430\u043a \u043c\u044b \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u043b\u0438 \u0441\u0438\u0441\u0442\u0435\u043c\u0443 \u0438 \u0442\u0435\u043c \u0441\u0430\u043c\u044b\u043c \u0437\u0430\u043a\u0440\u044b\u043b\u0438 \u044d\u0442\u0438 \u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\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-315026","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315026","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=315026"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/315026\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=315026"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=315026"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=315026"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}