{"id":307299,"date":"2020-07-22T09:00:20","date_gmt":"2020-07-22T09:00:20","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=307299"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=307299","title":{"rendered":"\u0422\u0435\u043c\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0434\u043b\u044f Xamarin.Forms"},"content":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/microsoft\/blog\/511642\/\">\u0412\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u041e\u0421 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0442\u0435\u043c\u043d\u044b\u0435 \u0438 \u0441\u0432\u0435\u0442\u043b\u044b\u0435 \u0442\u0435\u043c\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f Xamarin.Forms 4.7, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0444\u0438\u0447\u0438 \u0432 \u0432\u0430\u0448\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442\u0435, \u0432\u0430\u0448\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Xamarin.Forms \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f\u043c \u041e\u0421 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0417\u0430\u0447\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u043e\u043c? \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0432\u0435\u0442\u043b\u044b\u0435 \u0438 \u0442\u0435\u043c\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u0434\u0430\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0435\u043c\u043e\u0439 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/9s\/0g\/kv\/9s0gkvaz6mheuiys7zbfowqspzc.jpeg\"><a name=\"habracut\"><\/a><\/p>\n<h2>\u0426\u0432\u0435\u0442\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e<\/h2>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442\u0435 \u0441\u0442\u0438\u043b\u0438 \u0438\u043b\u0438 \u0446\u0432\u0435\u0442\u0430, \u0432\u0430\u0448 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441 \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u0442\u0435\u043c\u0435, \u043d\u0430\u0442\u0438\u0432\u043d\u043e\u0439 \u0434\u043b\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435, \u043a\u0430\u043a \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e\u0442 \u043d\u043e\u0432\u044b\u0439 \u0448\u0430\u0431\u043b\u043e\u043d \u00ab\u041f\u0443\u0441\u0442\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u00bb \u043d\u0430 iOS:<\/p>\n<pre><code class=\"cs\">&lt;StackLayout&gt;             &lt;Frame BackgroundColor=&quot;#2196F3&quot; Padding=&quot;36,48,36,36&quot; CornerRadius=&quot;0&quot;&gt;                 &lt;Label Text=&quot;Welcome to Xamarin.Forms!&quot; HorizontalTextAlignment=&quot;Center&quot; TextColor=&quot;White&quot; FontSize=&quot;36&quot; \/&gt;             &lt;\/Frame&gt;             &lt;Label Text=&quot;Start developing now&quot; FontSize=&quot;Title&quot; Padding=&quot;30,10,30,10&quot; \/&gt;             &lt;Label Text=&quot;Make changes to your XAML file and save to see your UI update in the running app with XAML Hot Reload. Give it a try!&quot; FontSize=&quot;16&quot; Padding=&quot;30,0,30,0&quot; \/&gt;             &lt;Label FontSize=&quot;16&quot; Padding=&quot;30,24,30,0&quot;&gt;                 &lt;Label.FormattedText&gt;                     &lt;FormattedString&gt;                         &lt;FormattedString.Spans&gt;                             &lt;Span Text=&quot;Learn more at &quot; \/&gt;                             &lt;Span Text=&quot;https:\/\/aka.ms\/xamarin-quickstart&quot; FontAttributes=&quot;Bold&quot; \/&gt;                         &lt;\/FormattedString.Spans&gt;                     &lt;\/FormattedString&gt;                 &lt;\/Label.FormattedText&gt;             &lt;\/Label&gt;         &lt;\/StackLayout&gt;<\/code><\/pre>\n<p>  <img decoding=\"async\" width=\"350\" src=\"https:\/\/habrastorage.org\/webt\/es\/6q\/wk\/es6qwk792fu6fovpyos22zu7yuy.gif\"><\/p>\n<p>  \u041a\u043e\u0433\u0434\u0430 \u0432\u044b \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435 \u0441\u0438\u043c\u0443\u043b\u044f\u0442\u043e\u0440 iOS \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c\u043d\u044b\u043c \u0438 \u0441\u0432\u0435\u0442\u043b\u044b\u043c \u0440\u0435\u0436\u0438\u043c\u0430\u043c\u0438 (CMD + SHFT + A), \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0432\u0438\u0434\u0435\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 \u0444\u043e\u043d\u0430 ContentPage \u0441 \u0431\u0435\u043b\u043e\u0433\u043e \u043d\u0430 \u0447\u0435\u0440\u043d\u044b\u0439 \u0438 \u0442\u0435\u043a\u0441\u0442\u0430 \u0441 \u0447\u0435\u0440\u043d\u043e\u0433\u043e \u043d\u0430 \u0431\u0435\u043b\u044b\u0439. \u042d\u0442\u043e \u0446\u0432\u0435\u0442\u0430 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0421\u0440\u0430\u0432\u043d\u0438\u0442\u0435 \u044d\u0442\u043e \u0441 \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u043e\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0441\u0438\u043d\u0438\u043c, \u0438 \u0442\u0435\u043a\u0441\u0442\u043e\u043c \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0431\u0435\u043b\u044b\u043c. \u042d\u0442\u043e \u044f\u0432\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<h2>\u0411\u0435\u0440\u0435\u043c \u043f\u043e\u0434 \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u0447\u0435\u0440\u043d\u044b\u0439<\/h2>\n<p>  \u0427\u0442\u043e\u0431\u044b \u0442\u0435\u043f\u0435\u0440\u044c \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0446\u0432\u0435\u0442\u0430\u043c\u0438 \u0434\u043b\u044f \u0442\u0435\u043c\u043d\u043e\u0433\u043e \u0438 \u0441\u0432\u0435\u0442\u043b\u043e\u0433\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430 \u0438 \u0442\u0435\u043a\u0441\u0442\u0430, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0446\u0432\u0435\u0442\u0430 \u043d\u0430 \u043f\u0440\u0438\u0432\u044f\u0437\u043a\u0443 AppThemeBinding, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043d\u0430 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0442\u0435\u043c\u044b \u041e\u0421. \u0421\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435 \u044d\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u044e, \u0434\u043e\u0431\u0430\u0432\u0438\u0432 \u0444\u043b\u0430\u0433 \u043a \u0432\u0430\u0448\u0435\u043c\u0443 App.xaml.cs:<\/p>\n<pre><code class=\"cs\">public App() {     Device.SetFlags(new string[]{ &quot;AppTheme_Experimental&quot; });      InitializeComponent(); }<\/code><\/pre>\n<p>  \u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0437\u0430\u0433\u043e\u043b\u043e\u0432\u043a\u0430, \u044d\u0442\u043e \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">&lt;Frame BackgroundColor=&quot;{AppThemeBinding Dark=#2196F3, Light=#2196F3}&quot; Padding=&quot;36,48,36,36&quot; CornerRadius=&quot;0&quot;&gt;                 &lt;Label Text=&quot;Welcome to Xamarin.Forms!&quot; HorizontalTextAlignment=&quot;Center&quot; TextColor=&quot;{AppThemeBinding Dark=DarkBlue, Light=White}&quot; FontSize=&quot;36&quot; \/&gt;             &lt;\/Frame&gt;<\/code><\/pre>\n<p>  <img decoding=\"async\" width=\"350\" src=\"https:\/\/habrastorage.org\/webt\/gw\/ym\/bj\/gwymbjrl-sljjt5purviteyqoem.gif\"><\/p>\n<p>  \u0412\u044b \u043c\u043e\u0436\u0435\u0442\u0435, \u043a\u043e\u043d\u0435\u0447\u043d\u043e, \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u0442\u0438\u043b\u0438, \u043a\u0430\u043a \u0437\u0434\u0435\u0441\u044c:<\/p>\n<pre><code class=\"cs\">&lt;ContentPage.Resources&gt;     &lt;Style x:Key=&quot;HeaderBg&quot; TargetType=&quot;Frame&quot;&gt;         &lt;Setter Property=&quot;BackgroundColor&quot; Value=&quot;{AppThemeBinding Dark=#1d1d1d, Light=#2196F3}&quot;\/&gt;         &lt;Setter Property=&quot;Padding&quot; Value=&quot;36,48,36,36&quot;\/&gt;         &lt;Setter Property=&quot;CornerRadius&quot; Value=&quot;0&quot;\/&gt;     &lt;\/Style&gt;      &lt;Style x:Key=&quot;HeaderTitle&quot; TargetType=&quot;Label&quot;&gt;         &lt;Setter Property=&quot;TextColor&quot; Value=&quot;{AppThemeBinding Dark=#F1F1F1, Light=White}&quot;\/&gt;         &lt;Setter Property=&quot;HorizontalTextAlignment&quot; Value=&quot;Center&quot;\/&gt;         &lt;Setter Property=&quot;FontSize&quot; Value=&quot;36&quot;\/&gt;     &lt;\/Style&gt; &lt;\/ContentPage.Resources&gt;  &lt;Frame Style=&quot;{StaticResource HeaderBg}&quot;&gt;     &lt;Label         Style=&quot;{StaticResource HeaderTitle}&quot;         Text=&quot;Welcome to Xamarin.Forms!&quot; \/&gt; &lt;\/Frame&gt;<\/code><\/pre>\n<p>  \u0418 \u0435\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u0435 \u0441\u0442\u0438\u043b\u0438 \u0446\u0432\u0435\u0442\u0430, \u044d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"cs\">&lt;Color x:Key=&quot;Background_Dark&quot;&gt;#1d1d1d&lt;\/Color&gt; &lt;Color x:Key=&quot;Background_Light&quot;&gt;#1d1d1d&lt;\/Color&gt; &lt;Style x:Key=&quot;HeaderBg&quot; TargetType=&quot;Frame&quot;&gt;     &lt;Setter Property=&quot;BackgroundColor&quot; Value=&quot;{AppThemeBinding Dark={StaticResource Background_Dark}, Light={StaticResource Background_Light}}&quot;\/&gt;<\/code><\/pre>\n<p>  <\/p>\n<h2>\u041f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u044b\u0431\u043e\u0440\u0430<\/h2>\n<p>  \u0418\u043d\u043e\u0433\u0434\u0430 \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0437\u0430\u0445\u043e\u0442\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c \u043d\u0430\u0434 \u0442\u0435\u043c\u043e\u0439, \u0430 \u043d\u0435 \u043f\u043e\u043b\u0430\u0433\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0442\u0435\u043c\u0443 \u041e\u0421. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c App.Current.UserAppTheme \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"cs\">App.Current.UserAppTheme = OSAppTheme.Dark;<\/code><\/pre>\n<p>  <img decoding=\"async\" width=\"350\" src=\"https:\/\/habrastorage.org\/webt\/er\/5a\/7c\/er5a7cpdjui3xxvbybjxfcw10wi.gif\"><\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c, \u0447\u0442\u043e\u0431\u044b \u0441\u0431\u0440\u043e\u0441\u0438\u0442\u044c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435, \u0447\u0442\u043e\u0431\u044b \u043e\u043d\u043e \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0440\u0435\u0430\u0433\u0438\u0440\u043e\u0432\u0430\u043b\u043e \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0442\u0435\u043c\u044b \u041e\u0421, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u00abUnspecified\u00bb:<\/p>\n<pre><code class=\"cs\">App.Current.UserAppTheme = OSAppTheme.Unspecified;<\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043e\u0437\u0434\u0430\u0439\u0442\u0435 \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043e\u043f\u044b\u0442 \u0438 \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u0442\u0440\u0438 \u0444\u043b\u0430\u0436\u043a\u0430 \u0432 \u0441\u0432\u043e\u0439 \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441: \u00ab\u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e\u00bb, \u00ab\u0442\u0435\u043c\u043d\u044b\u0439\u00bb \u0438 \u00ab\u0441\u0432\u0435\u0442\u043b\u044b\u0439\u00bb.<\/p>\n<pre><code class=\"cs\">&lt;StackLayout Orientation=&quot;Horizontal&quot; Spacing=&quot;10&quot;&gt;     &lt;CheckBox IsChecked=&quot;{Binding UseDeviceThemeSettings}&quot; VerticalOptions=&quot;Center&quot; \/&gt;     &lt;Label Text=&quot;Use device settings&quot;             VerticalOptions=&quot;Center&quot;\/&gt; &lt;\/StackLayout&gt;  &lt;StackLayout     IsVisible=&quot;{Binding UseDeviceThemeSettings, Converter={StaticResource InvertedBoolConverter}}&quot;     Orientation=&quot;Horizontal&quot;     Spacing=&quot;10&quot;&gt;     &lt;CheckBox IsChecked=&quot;{Binding UseDarkMode}&quot; VerticalOptions=&quot;Center&quot;\/&gt;     &lt;Label Text=&quot;Dark Theme&quot;             VerticalOptions=&quot;Center&quot;\/&gt; &lt;\/StackLayout&gt;  &lt;StackLayout     IsVisible=&quot;{Binding UseDeviceThemeSettings, Converter={StaticResource InvertedBoolConverter}}&quot;     Orientation=&quot;Horizontal&quot;     Spacing=&quot;10&quot;&gt;     &lt;CheckBox IsChecked=&quot;{Binding UseLightMode}&quot; VerticalOptions=&quot;Center&quot;\/&gt;     &lt;Label Text=&quot;Light Theme&quot;             VerticalOptions=&quot;Center&quot;\/&gt; &lt;\/StackLayout&gt;<\/code><\/pre>\n<p>  \u0417\u0430\u0442\u0435\u043c \u0434\u043e\u0431\u0430\u0432\u044c\u0442\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0435 \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 \u0432 BindingContext \u0434\u043b\u044f \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u0432 \u044d\u0442\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u0441\u0432\u043e\u0435 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0435 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435.<\/p>\n<pre><code class=\"cs\">public MainPage() {     BindingContext = this;     InitializeComponent(); }  private bool _useDarkMode; public bool UseDarkMode {     get {         return _useDarkMode;     }     set {         _useDarkMode = value;         if(_useDarkMode)         {             UseLightMode = UseDeviceThemeSettings = false;             App.Current.UserAppTheme = OSAppTheme.Dark;         }      } }  private bool _useLightMode; public bool UseLightMode {     get     {         return _useLightMode;     }     set     {         _useLightMode = value;         if (_useLightMode)         {             UseDarkMode = UseDeviceThemeSettings = false;             App.Current.UserAppTheme = OSAppTheme.Light;         }     } }  private bool _useDeviceThemeSettings = true; public bool UseDeviceThemeSettings {     get     {         return _useDeviceThemeSettings;     }     set     {         _useDeviceThemeSettings = value;         if(_useDeviceThemeSettings)         {             App.Current.UserAppTheme = OSAppTheme.Unspecified;         }     }  }<\/code><\/pre>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435 \u043a\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043c\u0435\u0436\u0434\u0443 \u0442\u0435\u043c\u043d\u044b\u043c \u0438 \u0441\u0432\u0435\u0442\u043b\u044b\u043c \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f\u043c\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f\u043c\u0438 \u0442\u0435\u043c\u044b \u041e\u0421.<\/p>\n<h2>\u041e\u0431\u0435\u0440\u0442\u043a\u0430!<\/h2>\n<p>  \u042d\u0442\u043e\u0442 \u043d\u043e\u0432\u044b\u0439 \u043f\u043e\u043c\u043e\u0449\u043d\u0438\u043a \u0432 \u0441\u043c\u0435\u043d\u0435 \u0442\u0435\u043c\u043d\u044b\u0445 \u0438 \u0441\u0432\u0435\u0442\u043b\u044b\u0445 \u0440\u0435\u0436\u0438\u043c\u043e\u0432 AppThemeBinding \u0432\u043c\u0435\u0441\u0442\u0435 \u0441 UserAppTheme \u0443\u043f\u0440\u043e\u0449\u0430\u044e\u0442 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 \u0442\u0435\u043c\u043d\u044b\u043c\u0438 \u0440\u0435\u0436\u0438\u043c\u0430\u043c\u0438 \u0432 \u0432\u0430\u0448\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445 Xamarin.Forms. \u042d\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0446\u0432\u0435\u0442\u043e\u0432, \u043d\u043e \u0438 \u0434\u043b\u044f \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0439 \u0438 \u0434\u0440\u0443\u0433\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432. \u041a\u0430\u043a \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u043e \u0440\u0430\u043d\u0435\u0435, \u043e\u043d \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0434\u0430\u0436\u0435 \u0441 \u043d\u043e\u0432\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u0430\u043c\u0438 \u0438 \u043f\u0443\u0442\u044f\u043c\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 Xamarin.Forms 4.7!<\/p>\n<p>  <img decoding=\"async\" width=\"350\" src=\"https:\/\/habrastorage.org\/webt\/pv\/wg\/bl\/pvwgbl3raxrtrhyd2l-3fm8ezqk.gif\"><\/p>\n<p>  \u0414\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043e \u0442\u0435\u043c\u0430\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u044c\u0442\u0435\u0441\u044c \u0441 <a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/theming\/system-theme-changes\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0435\u0439<\/a> \u043f\u043e \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0442\u0435\u043c. \u0415\u0441\u043b\u0438 \u0432\u044b \u0445\u043e\u0442\u0438\u0442\u0435 \u043f\u043e\u0439\u0442\u0438 \u0435\u0449\u0435 \u0434\u0430\u043b\u044c\u0448\u0435, \u0447\u0435\u043c \u0442\u0435\u043c\u043d\u044b\u0435 \u0438 \u0441\u0432\u0435\u0442\u043b\u044b\u0435 \u0442\u0435\u043c\u044b, \u0442\u043e\u0433\u0434\u0430 \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u0438 \u0434\u0430\u0436\u0435 \u0437\u0430\u0433\u0440\u0443\u0436\u0430\u0442\u044c \u0442\u0435\u043c\u044b \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f <a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/theming\/theming\">\u0442\u0435\u043c<\/a> \u0432 \u0441\u0432\u043e\u0438\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u0445.<\/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\/microsoft\/blog\/511642\/\"> https:\/\/habr.com\/ru\/company\/microsoft\/blog\/511642\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html post__text_v1\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/company\/microsoft\/blog\/511642\/\">\u0412\u0441\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u041e\u0421 \u0442\u0435\u043f\u0435\u0440\u044c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442 \u0442\u0435\u043c\u043d\u044b\u0435 \u0438 \u0441\u0432\u0435\u0442\u043b\u044b\u0435 \u0442\u0435\u043c\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439, \u0438 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f Xamarin.Forms 4.7, \u0447\u0442\u043e\u0431\u044b \u0443\u043f\u0440\u043e\u0441\u0442\u0438\u0442\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0444\u0438\u0447\u0438 \u0432 \u0432\u0430\u0448\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0435\u0441\u043b\u0438 \u0432\u044b \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u0442\u0435, \u0432\u0430\u0448\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f Xamarin.Forms \u0431\u0443\u0434\u0443\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0435\u043d\u0438\u044f\u043c \u041e\u0421 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f. \u0417\u0430\u0447\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0434\u043e\u0441\u0442\u0438\u0433\u043d\u0443\u0442\u043e\u043c? \u0412\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u0442\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0441\u0432\u0435\u0442\u043b\u044b\u0435 \u0438 \u0442\u0435\u043c\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0435 \u0432 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u043c \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0438 \u0434\u0430\u0436\u0435 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0435\u043c\u043e\u0439 \u0441\u0432\u043e\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043d\u0430\u0447\u043d\u0435\u043c \u0441 \u0441\u0430\u043c\u043e\u0433\u043e \u043d\u0430\u0447\u0430\u043b\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/9s\/0g\/kv\/9s0gkvaz6mheuiys7zbfowqspzc.jpeg\"><\/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-307299","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307299","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=307299"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/307299\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=307299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=307299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=307299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}