{"id":473939,"date":"2025-09-04T21:00:21","date_gmt":"2025-09-04T21:00:21","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=473939"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=473939","title":{"rendered":"<span>\u0421\u043b\u043e\u0432\u0430\u0440\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 WPF. \u041f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0442\u0435\u043c\u0443 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043b\u0435\u0442\u0443<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><u>\u0414\u043b\u044f \u043a\u043e\u0433\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f:<\/u><\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043f\u0438\u0441\u0430\u0442\u044c WPF. \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 &#8212; \u043e\u043f\u044b\u0442\u043d\u044b\u0435 WPF-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043d\u0430\u0439\u0434\u0443\u0442 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u0434\u043b\u044f \u0441\u0435\u0431\u044f.<\/p>\n<p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0431\u043e\u0440\u0430 \u0442\u0435\u043c\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0432\u0435\u0442\u043e\u043d\u043e\u043c. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043b\u044e\u0431\u044f\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0446\u0432\u0435\u0442\u043e\u0432\u0443\u044e \u0441\u0445\u0435\u043c\u0443, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u043e \u043d\u043e\u0447\u0430\u043c. \u0412 WPF \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u201c\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u201d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e: \u0437\u0430\u0434\u0430\u0451\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u044b (\u0446\u0432\u0435\u0442\u0430 \u0438 \u0441\u0442\u0438\u043b\u0438), \u0434\u0430\u0451\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438\u0445 \u043d\u0430 \u043b\u0435\u0442\u0443. \u041e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043c\u044b \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (ResourceDictionary):<\/p>\n<p>ResourceDictionary \u2013 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b: \u0446\u0432\u0435\u0442\u0430, \u0441\u0442\u0438\u043b\u0438 \u0438 \u0442.\u0434. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u043b\u044e\u0441: \u043a\u043b\u044e\u0447\u0438 (x:Key) \u0441\u043b\u0443\u0436\u0430\u0442 \u0438\u043c\u0435\u043d\u0430\u043c\u0438, \u0447\u0442\u043e \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f DynamicResource \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 Themes, \u0430 \u0432 \u043d\u0435\u0439 \u0434\u0432\u0430 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u044f: Light.xaml \u0438 Dark.xaml. \u0418 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0432 \u043d\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0446\u0432\u0435\u0442\u043e\u0432.<\/p>\n<p><em><u>Themes\/Light.xaml:<\/u><\/em><\/p>\n<pre><code class=\"cs\">&lt;ResourceDictionary xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"&gt;  \u00a0\u00a0\u00a0 &lt;Color x:Key=\"WindowBackgroundColor\"&gt;#FFFFFFFF&lt;\/Color&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"WindowBackgroundBrush\" Color=\"{StaticResource WindowBackgroundColor}\"\/&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"ButtonBackgroundBrush\" Color=\"LightGray\"\/&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"WindowForegroundBrush\" Color=\"#000000\"\/&gt;  &lt;\/ResourceDictionary&gt; <\/code><\/pre>\n<p><em><u>Themes\/Dark.xaml:<\/u><\/em><\/p>\n<pre><code class=\"cs\">&lt;ResourceDictionary xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"&gt;  \u00a0\u00a0\u00a0 &lt;Color x:Key=\"WindowBackgroundColor\"&gt;#FF2D2D30&lt;\/Color&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"WindowBackgroundBrush\" Color=\"{StaticResource WindowBackgroundColor}\"\/&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"ButtonBackgroundBrush\" Color=\"Gray\"\/&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"WindowForegroundBrush\" Color=\"#FFFFFF\"\/&gt;  &lt;\/ResourceDictionary&gt;<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 (WindowBackgroundBrush, WindowForegroundBrush \u0438 \u0442.\u0434.). \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442 \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043a \u044d\u0442\u0438\u043c \u043a\u043b\u044e\u0447\u0430\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/p>\n<p>\u0412 App.xaml \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043e\u0434\u043d\u0443 \u0438\u0437 \u0442\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0415\u0441\u043b\u0438 \u043c\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0430\u0448\u0438 \u00ab\u0441\u0442\u0438\u043b\u0438\u00bb:<\/p>\n<p><em><u>App.xaml:<\/u><\/em><\/p>\n<pre><code class=\"cs\">&lt;Application x:Class=\"WpfApp1.App\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns:local=\"clr-namespace:WpfApp1\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0StartupUri=\"MainWindow.xaml\"&gt;  \u00a0\u00a0\u00a0 &lt;Application.Resources&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;ResourceDictionary&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;ResourceDictionary.MergedDictionaries&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;ResourceDictionary Source=\"Themes\/Light.xaml\"\/&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/ResourceDictionary.MergedDictionaries&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/ResourceDictionary&gt;  \u00a0\u00a0\u00a0 &lt;\/Application.Resources&gt;  &lt;\/Application&gt;<\/code><\/pre>\n<p>\u00a0<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u043e\u043a\u043d\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0446\u0432\u0435\u0442\u043e\u0432 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0430\u0448\u0438 \u043a\u043b\u044e\u0447\u0438:<\/p>\n<p><em><u>MainWindow.xaml:<\/u><\/em><\/p>\n<pre><code class=\"cs\">&lt;Window x:Class=\"WpfApp1.MainWindow\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0Title=\"WPF Theme Demo\" Height=\"200\" Width=\"400\"&gt;  \u00a0\u00a0\u00a0 &lt;Grid Background=\"{DynamicResource WindowBackgroundBrush}\"&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;TextBlock Text=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u043a\u0441\u0442\u0430\" Foreground=\"{DynamicResource WindowForegroundBrush}\"   \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0FontSize=\"16\" Margin=\"10\"\/&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;Button Background=\"{DynamicResource ButtonBackgroundBrush}\" HorizontalAlignment=\"Left\" Content=\"Light\" Width=\"80\" Height=\"30\" Margin=\"80,0,0,0\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0Click=\"Light_Click\" \/&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;Button Background=\"{DynamicResource ButtonBackgroundBrush}\" HorizontalAlignment=\"Left\" Content=\"Dark\" Width=\"80\" Height=\"30\" Margin=\"160,0,0,0\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0Click=\"Dark_Click\" \/&gt;  \u00a0\u00a0\u00a0 &lt;\/Grid&gt;  &lt;\/Window&gt;<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0435\u043c\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043a\u043d\u043e\u043f\u043a\u0438 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u044e), \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438 \u00ab\u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u00bb \u043d\u0443\u0436\u043d\u044b\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 ApplyTheme:<\/p>\n<p><em><u>MainWindow.xaml.cs:<\/u><\/em><\/p>\n<pre><code class=\"cs\">void ApplyTheme(string themePath)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var themeDict = new ResourceDictionary { Source = new Uri(themePath, UriKind.Relative) };  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ \u041e\u0447\u0438\u0449\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Application.Current.Resources.MergedDictionaries.Clear();  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Application.Current.Resources.MergedDictionaries.Add(themeDict);  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c (Clear()), \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u0435\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0441\u0443\u0440\u0441 \u0441 \u0442\u0435\u043c \u0436\u0435 \u043a\u043b\u044e\u0447\u043e\u043c.<\/p>\n<p>\u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 ApplyTheme, \u043d\u0430 \u0432\u0445\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043f\u0443\u0442\u044c \u0434\u043e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0444\u0430\u0439\u043b\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f:<\/p>\n<p><em><u>MainWindow.xaml.cs:<\/u><\/em><\/p>\n<pre><code class=\"cs\">private void Light_Click(object sender, RoutedEventArgs e)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ApplyTheme(\"Themes\/Light.xaml\");  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0  private void Dark_Click(object sender, RoutedEventArgs e)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ApplyTheme(\"Themes\/Dark.xaml\");  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/code><\/pre>\n<p>\u041f\u043e \u0438\u0442\u043e\u0433\u0443 <em><u>MainWindow.xaml.cs<\/u><\/em> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/p>\n<pre><code class=\"cs\">using System;  using System.Windows;  \u00a0  namespace WpfApp1  {  \u00a0\u00a0\u00a0 public partial class MainWindow : Window  \u00a0\u00a0\u00a0 {  \u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 void ApplyTheme(string themePath)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var themeDict = new ResourceDictionary { Source = new Uri(themePath, UriKind.Relative) };  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ \u041e\u0447\u0438\u0449\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Application.Current.Resources.MergedDictionaries.Clear();  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Application.Current.Resources.MergedDictionaries.Add(themeDict);  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public MainWindow()  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 InitializeComponent();  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 private void Light_Click(object sender, RoutedEventArgs e)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ApplyTheme(\"Themes\/Light.xaml\");  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 private void Dark_Click(object sender, RoutedEventArgs e)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ApplyTheme(\"Themes\/Dark.xaml\");  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0\u00a0\u00a0 }  }<\/code><\/pre>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h4>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 Visual Studio:<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9e6\/701\/a8c\/9e6701a8c6ef370122071a4d1cb4afc2.png\" alt=\"\" title=\"\" width=\"2036\" height=\"964\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/9e6\/701\/a8c\/9e6701a8c6ef370122071a4d1cb4afc2.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/9e6\/701\/a8c\/9e6701a8c6ef370122071a4d1cb4afc2.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<div class=\"floating-image\">\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<\/div>\n<p>\u0412\u0438\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0435\u043b\u0430\u044f \u0442\u0435\u043c\u0430, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f \u043d\u0430\u043c\u0438 \u0432 App.xaml):<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/be6\/7af\/c28\/be67afc28161b73e2f170580c5999e5a.png\" width=\"377\" height=\"188\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/be6\/7af\/c28\/be67afc28161b73e2f170580c5999e5a.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/be6\/7af\/c28\/be67afc28161b73e2f170580c5999e5a.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<div class=\"floating-image\">\n<p>\u041d\u0430\u0436\u0430\u043b\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u00abDark\u00bb:<\/p>\n<\/div>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6c9\/d76\/d83\/6c9d76d83d8fada4404b426214c85b1e.png\" width=\"378\" height=\"184\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/6c9\/d76\/d83\/6c9d76d83d8fada4404b426214c85b1e.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/6c9\/d76\/d83\/6c9d76d83d8fada4404b426214c85b1e.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u041d\u0430\u0436\u0430\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0443 \u00abLight\u00bb:<\/p>\n<figure class=\"\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/085\/ac6\/981\/085ac69813f57c77d628847f9a2aa433.png\" width=\"379\" height=\"186\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/085\/ac6\/981\/085ac69813f57c77d628847f9a2aa433.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/085\/ac6\/981\/085ac69813f57c77d628847f9a2aa433.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/figure>\n<p>\u00a0<\/p>\n<h4>\u0412\u0430\u0436\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b<\/h4>\n<p><strong>DynamicResource vs StaticResource.<\/strong> \u041a\u0430\u043a \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b (\u043a\u0438\u0441\u0442\u0438, \u0446\u0432\u0435\u0442\u0430, \u0441\u0442\u0438\u043b\u0438), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u0442\u0435\u043c\u044b, \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c DynamicResource. StaticResource \u0432\u044b\u0433\u043e\u0434\u0435\u043d \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u043e\u043d \u043d\u0435 \u00ab\u043e\u0442\u043a\u043b\u0438\u043a\u0430\u0435\u0442\u0441\u044f\u00bb \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439.<\/strong> \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 MergedDictionaries, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0438\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435.<\/p>\n<p><strong>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043a\u043e\u043d.<\/strong> \u0415\u0441\u043b\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043e\u043a\u043e\u043d, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 <em>Application.Current.Resources<\/em> \u0437\u0430\u0442\u0440\u043e\u043d\u0435\u0442 \u0438\u0445 \u0432\u0441\u0435. \u041d\u043e \u0435\u0441\u043b\u0438 \u0443 \u043e\u043a\u043d\u0430 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f Resources, \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u043b\u0438\u0431\u043e \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043e\u043a\u043e\u043d.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/943908\/\"> https:\/\/habr.com\/ru\/articles\/943908\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<p><u>\u0414\u043b\u044f \u043a\u043e\u0433\u043e \u044d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f:<\/u><\/p>\n<p>\u042d\u0442\u0430 \u0441\u0442\u0430\u0442\u044c\u044f \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043b\u0435\u0437\u043d\u0430 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442 \u043f\u0438\u0441\u0430\u0442\u044c WPF. \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 \u043c\u0435\u0445\u0430\u043d\u0438\u043a\u0430 \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 &#8212; \u043e\u043f\u044b\u0442\u043d\u044b\u0435 WPF-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0432\u0440\u044f\u0434 \u043b\u0438 \u043d\u0430\u0439\u0434\u0443\u0442 \u0447\u0442\u043e-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0435 \u0434\u043b\u044f \u0441\u0435\u0431\u044f.<\/p>\n<p>\u0412 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u043c \u043c\u0438\u0440\u0435 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0431\u043e\u0440\u0430 \u0442\u0435\u043c\u044b \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0441\u0447\u0438\u0442\u0430\u0435\u0442\u0441\u044f \u043c\u043e\u0432\u0435\u0442\u043e\u043d\u043e\u043c. \u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0438 \u043b\u044e\u0431\u044f\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u0443\u044e \u0434\u043b\u044f \u0441\u0435\u0431\u044f \u0446\u0432\u0435\u0442\u043e\u0432\u0443\u044e \u0441\u0445\u0435\u043c\u0443, \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u043f\u043e \u043d\u043e\u0447\u0430\u043c. \u0412 WPF \u0442\u0430\u043a\u043e\u0435 \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043d\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u043e \u201c\u0438\u0437 \u043a\u043e\u0440\u043e\u0431\u043a\u0438\u201d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0451\u043c \u0441\u0432\u043e\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e: \u0437\u0430\u0434\u0430\u0451\u043c \u0440\u0435\u0441\u0443\u0440\u0441\u044b (\u0446\u0432\u0435\u0442\u0430 \u0438 \u0441\u0442\u0438\u043b\u0438), \u0434\u0430\u0451\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0438\u0445 \u043d\u0430 \u043b\u0435\u0442\u0443. \u041e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u0430 \u043c\u044b \u0438 \u043f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>\u0414\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0439 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u043c\u0438 \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 (ResourceDictionary):<\/p>\n<p>ResourceDictionary \u2013 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439, \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b: \u0446\u0432\u0435\u0442\u0430, \u0441\u0442\u0438\u043b\u0438 \u0438 \u0442.\u0434. \u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u043b\u044e\u0441: \u043a\u043b\u044e\u0447\u0438 (x:Key) \u0441\u043b\u0443\u0436\u0430\u0442 \u0438\u043c\u0435\u043d\u0430\u043c\u0438, \u0447\u0442\u043e \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f DynamicResource \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043d\u0430\u043c \u043c\u0435\u043d\u044f\u0442\u044c \u0438\u0445 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043f\u0430\u043f\u043a\u0443 Themes, \u0430 \u0432 \u043d\u0435\u0439 \u0434\u0432\u0430 \u0442\u0430\u043a\u0438\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u044f: Light.xaml \u0438 Dark.xaml. \u0418 \u0437\u0430\u0434\u0430\u0434\u0438\u043c \u0432 \u043d\u0438\u0445 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0446\u0432\u0435\u0442\u043e\u0432.<\/p>\n<p><em><u>Themes\/Light.xaml:<\/u><\/em><\/p>\n<pre><code class=\"cs\">&lt;ResourceDictionary xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"&gt;  \u00a0\u00a0\u00a0 &lt;Color x:Key=\"WindowBackgroundColor\"&gt;#FFFFFFFF&lt;\/Color&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"WindowBackgroundBrush\" Color=\"{StaticResource WindowBackgroundColor}\"\/&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"ButtonBackgroundBrush\" Color=\"LightGray\"\/&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"WindowForegroundBrush\" Color=\"#000000\"\/&gt;  &lt;\/ResourceDictionary&gt; <\/code><\/pre>\n<p><em><u>Themes\/Dark.xaml:<\/u><\/em><\/p>\n<pre><code class=\"cs\">&lt;ResourceDictionary xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"&gt;  \u00a0\u00a0\u00a0 &lt;Color x:Key=\"WindowBackgroundColor\"&gt;#FF2D2D30&lt;\/Color&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"WindowBackgroundBrush\" Color=\"{StaticResource WindowBackgroundColor}\"\/&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"ButtonBackgroundBrush\" Color=\"Gray\"\/&gt;  \u00a0\u00a0\u00a0 &lt;SolidColorBrush x:Key=\"WindowForegroundBrush\" Color=\"#FFFFFF\"\/&gt;  &lt;\/ResourceDictionary&gt;<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e, \u0447\u0442\u043e \u0432 \u043e\u0431\u043e\u0438\u0445 \u0441\u043b\u043e\u0432\u0430\u0440\u044f\u0445 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u043a\u043b\u044e\u0447\u0438 (WindowBackgroundBrush, WindowForegroundBrush \u0438 \u0442.\u0434.). \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0438\u0437\u043c\u0435\u043d\u0438\u0442 \u0432\u0441\u0435 \u043f\u0440\u0438\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u043a \u044d\u0442\u0438\u043c \u043a\u043b\u044e\u0447\u0430\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/p>\n<p>\u0412 App.xaml \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0438\u043c \u043e\u0434\u043d\u0443 \u0438\u0437 \u0442\u0435\u043c \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e. \u0415\u0441\u043b\u0438 \u043c\u044b \u044d\u0442\u043e\u0433\u043e \u043d\u0435 \u0441\u0434\u0435\u043b\u0430\u0435\u043c, \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 \u0446\u0432\u0435\u0442\u0430, \u0442\u0430\u043a \u043a\u0430\u043a \u043d\u0435 \u0431\u0443\u0434\u0435\u0442 \u0437\u043d\u0430\u0442\u044c \u043f\u0440\u043e \u043d\u0430\u0448\u0438 \u00ab\u0441\u0442\u0438\u043b\u0438\u00bb:<\/p>\n<p><em><u>App.xaml:<\/u><\/em><\/p>\n<pre><code class=\"cs\">&lt;Application x:Class=\"WpfApp1.App\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns:local=\"clr-namespace:WpfApp1\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0StartupUri=\"MainWindow.xaml\"&gt;  \u00a0\u00a0\u00a0 &lt;Application.Resources&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;ResourceDictionary&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;ResourceDictionary.MergedDictionaries&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;ResourceDictionary Source=\"Themes\/Light.xaml\"\/&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/ResourceDictionary.MergedDictionaries&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;\/ResourceDictionary&gt;  \u00a0\u00a0\u00a0 &lt;\/Application.Resources&gt;  &lt;\/Application&gt;<\/code><\/pre>\n<p>\u00a0<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432 \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u043e\u043a\u043d\u0430 \u0432\u043c\u0435\u0441\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0445 \u0446\u0432\u0435\u0442\u043e\u0432 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0430\u0448\u0438 \u043a\u043b\u044e\u0447\u0438:<\/p>\n<p><em><u>MainWindow.xaml:<\/u><\/em><\/p>\n<pre><code class=\"cs\">&lt;Window x:Class=\"WpfApp1.MainWindow\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\/presentation\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0xmlns:x=\"http:\/\/schemas.microsoft.com\/winfx\/2006\/xaml\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0Title=\"WPF Theme Demo\" Height=\"200\" Width=\"400\"&gt;  \u00a0\u00a0\u00a0 &lt;Grid Background=\"{DynamicResource WindowBackgroundBrush}\"&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;TextBlock Text=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0442\u0435\u043a\u0441\u0442\u0430\" Foreground=\"{DynamicResource WindowForegroundBrush}\"   \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0FontSize=\"16\" Margin=\"10\"\/&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;Button Background=\"{DynamicResource ButtonBackgroundBrush}\" HorizontalAlignment=\"Left\" Content=\"Light\" Width=\"80\" Height=\"30\" Margin=\"80,0,0,0\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0Click=\"Light_Click\" \/&gt;  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 &lt;Button Background=\"{DynamicResource ButtonBackgroundBrush}\" HorizontalAlignment=\"Left\" Content=\"Dark\" Width=\"80\" Height=\"30\" Margin=\"160,0,0,0\"  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \u00a0Click=\"Dark_Click\" \/&gt;  \u00a0\u00a0\u00a0 &lt;\/Grid&gt;  &lt;\/Window&gt;<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u043c\u0435\u043d\u044f\u0442\u044c \u0442\u0435\u043c\u0443 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043a\u043d\u043e\u043f\u043a\u0438 \u0438\u043b\u0438 \u0447\u0435\u0440\u0435\u0437 \u043c\u0435\u043d\u044e), \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0443\u0436\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0439\u0441\u044f \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0438 \u00ab\u043f\u043e\u0434\u0433\u0440\u0443\u0437\u0438\u0442\u044c\u00bb \u043d\u0443\u0436\u043d\u044b\u0439. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043c\u0435\u0442\u043e\u0434 ApplyTheme:<\/p>\n<p><em><u>MainWindow.xaml.cs:<\/u><\/em><\/p>\n<pre><code class=\"cs\">void ApplyTheme(string themePath)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var themeDict = new ResourceDictionary { Source = new Uri(themePath, UriKind.Relative) };  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ \u041e\u0447\u0438\u0449\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Application.Current.Resources.MergedDictionaries.Clear();  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Application.Current.Resources.MergedDictionaries.Add(themeDict);  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/code><\/pre>\n<p>\u0412\u0430\u0436\u043d\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0441\u0442\u0430\u0440\u044b\u0439 \u0441\u043b\u043e\u0432\u0430\u0440\u044c (Clear()), \u0438\u043d\u0430\u0447\u0435 \u043c\u043e\u0436\u0435\u0442 \u0434\u0443\u0431\u043b\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0440\u0435\u0441\u0443\u0440\u0441 \u0441 \u0442\u0435\u043c \u0436\u0435 \u043a\u043b\u044e\u0447\u043e\u043c.<\/p>\n<p>\u0412 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445 \u043a\u043d\u043e\u043f\u043e\u043a \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u043c\u0435\u0442\u043e\u0434 ApplyTheme, \u043d\u0430 \u0432\u0445\u043e\u0434 \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u043c \u043f\u0443\u0442\u044c \u0434\u043e \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u043d\u0430\u043c \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043a\u043d\u043e\u043f\u043a\u0438 \u0444\u0430\u0439\u043b\u0430 \u0440\u0435\u0441\u0443\u0440\u0441\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f:<\/p>\n<p><em><u>MainWindow.xaml.cs:<\/u><\/em><\/p>\n<pre><code class=\"cs\">private void Light_Click(object sender, RoutedEventArgs e)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ApplyTheme(\"Themes\/Light.xaml\");  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0  private void Dark_Click(object sender, RoutedEventArgs e)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ApplyTheme(\"Themes\/Dark.xaml\");  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }<\/code><\/pre>\n<p>\u041f\u043e \u0438\u0442\u043e\u0433\u0443 <em><u>MainWindow.xaml.cs<\/u><\/em> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a<\/p>\n<pre><code class=\"cs\">using System;  using System.Windows;  \u00a0  namespace WpfApp1  {  \u00a0\u00a0\u00a0 public partial class MainWindow : Window  \u00a0\u00a0\u00a0 {  \u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 void ApplyTheme(string themePath)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ \u0417\u0430\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 var themeDict = new ResourceDictionary { Source = new Uri(themePath, UriKind.Relative) };  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 \/\/ \u041e\u0447\u0438\u0449\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u0435 \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u043e\u0432\u044b\u0439  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Application.Current.Resources.MergedDictionaries.Clear();  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 Application.Current.Resources.MergedDictionaries.Add(themeDict);  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 public MainWindow()  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 InitializeComponent();  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 private void Light_Click(object sender, RoutedEventArgs e)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ApplyTheme(\"Themes\/Light.xaml\");  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 private void Dark_Click(object sender, RoutedEventArgs e)  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 {  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 ApplyTheme(\"Themes\/Dark.xaml\");  \u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 }  \u00a0\u00a0\u00a0 }  }<\/code><\/pre>\n<h4>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h4>\n<p>\u0417\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043d\u0430\u0448 \u043f\u0440\u043e\u0435\u043a\u0442 \u0432 Visual Studio:<\/p>\n<figure class=\"full-width\"><\/figure>\n<div class=\"floating-image\">\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435:<\/p>\n<\/div>\n<p>\u0412\u0438\u0434 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043f\u0440\u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0435 (\u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0431\u0435\u043b\u0430\u044f \u0442\u0435\u043c\u0430, \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0430\u044f \u043d\u0430\u043c\u0438 \u0432 App.xaml):<\/p>\n<figure class=\"\"><\/figure>\n<div class=\"floating-image\">\n<p>\u041d\u0430\u0436\u0430\u043b\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u00abDark\u00bb:<\/p>\n<\/div>\n<figure class=\"\"><\/figure>\n<p>\u041d\u0430\u0436\u0430\u043b\u0438 \u043a\u043d\u043e\u043f\u043a\u0443 \u00abLight\u00bb:<\/p>\n<figure class=\"\"><\/figure>\n<p>\u00a0<\/p>\n<h4>\u0412\u0430\u0436\u043d\u044b\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b<\/h4>\n<p><strong>DynamicResource vs StaticResource.<\/strong> \u041a\u0430\u043a \u0443\u0436\u0435 \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0432\u0441\u0435 \u0440\u0435\u0441\u0443\u0440\u0441\u044b (\u043a\u0438\u0441\u0442\u0438, \u0446\u0432\u0435\u0442\u0430, \u0441\u0442\u0438\u043b\u0438), \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u0435\u043d\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u0438 \u0441\u043c\u0435\u043d\u0435 \u0442\u0435\u043c\u044b, \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c DynamicResource. StaticResource \u0432\u044b\u0433\u043e\u0434\u0435\u043d \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u043e\u043d \u043d\u0435 \u00ab\u043e\u0442\u043a\u043b\u0438\u043a\u0430\u0435\u0442\u0441\u044f\u00bb \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0440\u0435\u0441\u0443\u0440\u0441\u043e\u0432 \u0432\u043e \u0432\u0440\u0435\u043c\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f.<\/p>\n<p><strong>\u041f\u043e\u0440\u044f\u0434\u043e\u043a \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439.<\/strong> \u0415\u0441\u043b\u0438 \u0432\u044b \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0435 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u0435\u0439 \u0447\u0435\u0440\u0435\u0437 MergedDictionaries, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0439\u0442\u0435, \u0447\u0442\u043e \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u043a\u043e\u043d\u0444\u043b\u0438\u043a\u0442\u0443\u044e\u0449\u0438\u0445 \u043a\u043b\u044e\u0447\u0435\u0439 \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0441\u043b\u043e\u0432\u0430\u0440\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435.<\/p>\n<p><strong>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u043a\u043e\u043d.<\/strong> \u0415\u0441\u043b\u0438 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0445 \u043e\u043a\u043e\u043d, \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0435 <em>Application.Current.Resources<\/em> \u0437\u0430\u0442\u0440\u043e\u043d\u0435\u0442 \u0438\u0445 \u0432\u0441\u0435. \u041d\u043e \u0435\u0441\u043b\u0438 \u0443 \u043e\u043a\u043d\u0430 \u0435\u0441\u0442\u044c \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0430\u044f \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f Resources, \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u043b\u0438\u0431\u043e \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043d\u0430\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435, \u043b\u0438\u0431\u043e \u0442\u0430\u043a\u0436\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0440\u0435\u0441\u0443\u0440\u0441\u044b \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0445 \u043e\u043a\u043e\u043d.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \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\/articles\/943908\/\"> https:\/\/habr.com\/ru\/articles\/943908\/<\/a><br \/><\/br><\/br><\/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-473939","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/473939","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=473939"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/473939\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=473939"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=473939"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=473939"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}