{"id":386915,"date":"2024-06-29T07:00:01","date_gmt":"2024-06-29T07:00:01","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=386915"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-06-29T07:00:01","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=386915","title":{"rendered":"<span>\u0410\u043d\u043e\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u043d \u0432\u044b\u043f\u0443\u0441\u043a .NET Community Toolkit 8.0<\/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<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/16c\/5be\/2ef\/16c5be2ef01d4589b310c1283eaa1291.png\" width=\"1920\" height=\"1080\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/16c\/5be\/2ef\/16c5be2ef01d4589b310c1283eaa1291.png\"\/><figcaption><\/figcaption><\/figure>\n<p>.NET Community Toolkit &#8212; \u044d\u0442\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432-\u0445\u0435\u043b\u043f\u0435\u0440\u043e\u0432 \u0438 API, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 .NET &#8212; \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<p>Toolkit \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f Microsoft \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e .NET Foundation.<\/p>\n<p><a href=\"https:\/\/github.com\/CommunityToolkit\/dotnet\" rel=\"noopener noreferrer nofollow\">.NET Community Toolkit <\/a>&#8212; \u044d\u0442\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a <a href=\"https:\/\/github.com\/CommunityToolkit\/WindowsCommunityToolkit\" rel=\"noopener noreferrer nofollow\">Windows Community Toolkit<\/a>. \u0415\u0433\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0440\u043e\u0441\u043b\u043e \u0447\u0438\u0441\u043b\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a API, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 .NET \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Windows. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0438 \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0434\u043b\u044f .NET-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435 \u0434\u043b\u044f Windows. <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f Windows Community Toolkit \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u044b\u043b\u0430 7.1.x, \u0442\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u043b\u0438\u0437 .NET Community Toolkit \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043a\u0430\u043a 8.0.0. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043e\u0431\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e.\u00a0<\/p>\n<h2>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 .NET Community Toolkit:<\/h2>\n<ul>\n<li>\n<p><code>CommunityToolkit.Common<\/code><\/p>\n<\/li>\n<li>\n<p><code>CommunityToolkit.Mvvm<\/code>\u00a0(aka \u201cMicrosoft MVVM Toolkit\u201d)<\/p>\n<\/li>\n<li>\n<p><code>CommunityToolkit.Diagnostics<\/code><\/p>\n<\/li>\n<li>\n<p><code>CommunityToolkit.HighPerformance<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 Toolkit&#8217;a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f MVVM Toolkit. \u0412 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u043b\u0435\u0436\u0438\u0442 <a href=\"https:\/\/www.nuget.org\/packages\/MvvmLight\" rel=\"noopener noreferrer nofollow\">MVVMLight<\/a>, \u0440\u0430\u043d\u0435\u0435 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 MVVM (\u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f). \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 MVVMLight, \u0435\u0441\u0442\u044c <a href=\"https:\/\/docs.microsoft.com\/dotnet\/communitytoolkit\/mvvm\/migratingfrommvvmlight\" rel=\"noopener noreferrer nofollow\">\u043f\u043b\u0430\u043d \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 Microsoft MVVM Toolkit<\/a>.<\/p>\n<p>\u0412 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 8.0.0 \u0432 \u043f\u043b\u0430\u043d\u0435 \u0438\u043c\u0435\u043d\u043d\u043e MVVM Toolkit&#8217;a.<\/p>\n<p>\u0417\u0430\u044f\u0432\u043b\u0435\u043d\u043e \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043a\u043e\u0434\u0430 (source generators), \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e boilerplate-\u043a\u043e\u0434\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Commands:<\/summary>\n<div class=\"spoiler__content\">\n<details class=\"spoiler\">\n<summary>\u0431\u044b\u043b\u043e:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">private IRelayCommand&lt;User> greetUserCommand;  public IRelayCommand&lt;User> GreetUserCommand => greetUserCommand ??= new RelayCommand&lt;User>(GreetUser);  private void GreetUser(User user) {     Console.WriteLine($\"Hello {user.Name}!\"); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0441\u0442\u0430\u043b\u043e:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">[RelayCommand] private void GreetUser(User user) {     Console.WriteLine($\"Hello {user.Name}!\"); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Observable properties:<\/summary>\n<div class=\"spoiler__content\">\n<details class=\"spoiler\">\n<summary>\u0431\u044b\u043b\u043e:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">private string? firstName;  public string? FirstName {     get => firstName;     set     {         if (SetProperty(ref firstName, value))         {             OnPropertyChanged(nameof(FullName));             GreetUserCommand.NotifyCanExecuteChanged();         }     } }  private string? lastName;  public string? LastName {     get => lastName;     set     {         if (SetProperty(ref lastName, value))         {             OnPropertyChanged(nameof(FullName));             GreetUserCommand.NotifyCanExecuteChanged();         }     } }  public string? FullName => $\"{FirstName} {LastName}\";<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0441\u0442\u0430\u043b\u043e:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">[ObservableProperty] [NotifyPropertyChangedFor(nameof(FullName))] [NotifyCanExecuteChangedFor(nameof(GreetUserCommand))] private string? firstName;  [ObservableProperty] [NotifyPropertyChangedFor(nameof(FullName))] [NotifyCanExecuteChangedFor(nameof(GreetUserCommand))] private string? lastName;  public string? FullName => $\"{FirstName} {LastName}\";<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <strong>[ObservableProperty]<\/strong> MVVM Toolkit \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430: <strong>On&lt;PROPERTY_NAME>Changing<\/strong> \u0438 <strong>On&lt;PROPERTY_NAME>Changed<\/strong><\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432\u0438\u0434\u0430<\/p>\n<pre><code class=\"cs\">[ObservableProperty] private string name;  partial void OnNameChanging(string name) {     Console.WriteLine($\"The name is about to change to {name}!\"); }  partial void OnNameChanged(string name) {     Console.WriteLine($\"The name just changed to {name}!\"); }<\/code><\/pre>\n<p>\u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0451\u0442\u0441\u044f \u0432<\/p>\n<pre><code class=\"cs\">public string Name {     get => name;     set     {         if (!EqualityComparer&lt;string>.Default.Equals(name, value))         {             OnNameChanging(value);             OnPropertyChanging();             name = value;             OnNameChanged();             OnPropertyChanged();         }     } }  partial void OnNameChanging(string name);  partial void OnNameChanged(string name);<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-the-dotnet-community-toolkit-800\/\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u043e\u043d\u0441.<\/a><\/p>\n<p><a href=\"https:\/\/aka.ms\/toolkit\/docs\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e.<\/a><\/p>\n<p><a href=\"https:\/\/www.microsoft.com\/store\/apps\/9NKLCF1LVZ5H\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 Microsoft Store.<\/a> <\/p>\n<\/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\/681002\/\"> https:\/\/habr.com\/ru\/articles\/681002\/<\/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<figure class=\"full-width\"><figcaption><\/figcaption><\/figure>\n<p>.NET Community Toolkit &#8212; \u044d\u0442\u043e \u043a\u043e\u043b\u043b\u0435\u043a\u0446\u0438\u044f \u043a\u043b\u0430\u0441\u0441\u043e\u0432-\u0445\u0435\u043b\u043f\u0435\u0440\u043e\u0432 \u0438 API, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u0443\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0435 .NET &#8212; \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u0438 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u044f\u0442 \u043e\u0442 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e\u0439 \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u043e\u0433\u043e \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430.<\/p>\n<p>Toolkit \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438 \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u0435\u0442\u0441\u044f Microsoft \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e .NET Foundation.<\/p>\n<p><a href=\"https:\/\/github.com\/CommunityToolkit\/dotnet\" rel=\"noopener noreferrer nofollow\">.NET Community Toolkit <\/a>&#8212; \u044d\u0442\u043e \u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a <a href=\"https:\/\/github.com\/CommunityToolkit\/WindowsCommunityToolkit\" rel=\"noopener noreferrer nofollow\">Windows Community Toolkit<\/a>. \u0415\u0433\u043e \u043f\u043e\u044f\u0432\u043b\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0438 \u043e\u0431\u044a\u044f\u0441\u043d\u044f\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:  \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0440\u043e\u0441\u043b\u043e \u0447\u0438\u0441\u043b\u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a API, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0438\u0445 .NET \u0438 \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0440\u0430\u0431\u043e\u0442\u0443 \u0441 Windows. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u044b\u043b\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0432\u044b\u0434\u0435\u043b\u0438\u0442\u044c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0447\u0442\u043e\u0431\u044b \u0438\u043c\u0435\u0442\u044c \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u0438 \u0431\u044b\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u043c \u0434\u043b\u044f .NET-\u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u043e\u0432 \u043d\u0435 \u0434\u043b\u044f Windows. <\/p>\n<p>\u0422\u0430\u043a \u043a\u0430\u043a \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u044f\u044f \u0432\u0435\u0440\u0441\u0438\u044f Windows Community Toolkit \u043f\u0435\u0440\u0435\u0434 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u0435\u043c \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u044b\u043b\u0430 7.1.x, \u0442\u043e \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0435\u043b\u0438\u0437 .NET Community Toolkit \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u043a\u0430\u043a 8.0.0. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043e\u0431\u0430 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u0431\u0443\u0434\u0443\u0442 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0438 \u0432\u0435\u0440\u0441\u0438\u043e\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e.\u00a0<\/p>\n<h2>\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0432\u0445\u043e\u0434\u044f\u0449\u0438\u0435 \u0432 .NET Community Toolkit:<\/h2>\n<ul>\n<li>\n<p><code>CommunityToolkit.Common<\/code><\/p>\n<\/li>\n<li>\n<p><code>CommunityToolkit.Mvvm<\/code>\u00a0(aka \u201cMicrosoft MVVM Toolkit\u201d)<\/p>\n<\/li>\n<li>\n<p><code>CommunityToolkit.Diagnostics<\/code><\/p>\n<\/li>\n<li>\n<p><code>CommunityToolkit.HighPerformance<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0434\u043d\u0438\u043c \u0438\u0437 \u0441\u0430\u043c\u044b\u0445 \u0432\u0430\u0436\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u043e\u0432 Toolkit&#8217;a \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f MVVM Toolkit. \u0412 \u0435\u0433\u043e \u043e\u0441\u043d\u043e\u0432\u0435 \u043b\u0435\u0436\u0438\u0442 <a href=\"https:\/\/www.nuget.org\/packages\/MvvmLight\" rel=\"noopener noreferrer nofollow\">MVVMLight<\/a>, \u0440\u0430\u043d\u0435\u0435 \u043a\u0440\u0430\u0439\u043d\u0435 \u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u0430\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u0430 MVVM (\u0432 \u043d\u0430\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442\u0441\u044f). \u0414\u043b\u044f \u0442\u0435\u0445, \u043a\u0442\u043e \u0434\u043e \u0441\u0438\u0445 \u043f\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442 MVVMLight, \u0435\u0441\u0442\u044c <a href=\"https:\/\/docs.microsoft.com\/dotnet\/communitytoolkit\/mvvm\/migratingfrommvvmlight\" rel=\"noopener noreferrer nofollow\">\u043f\u043b\u0430\u043d \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0430 \u043d\u0430 Microsoft MVVM Toolkit<\/a>.<\/p>\n<p>\u0412 \u0434\u0432\u0443\u0445 \u0441\u043b\u043e\u0432\u0430\u0445 \u043e \u043d\u043e\u0432\u044b\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044f\u0445 \u0432 \u0432\u0435\u0440\u0441\u0438\u0438 8.0.0 \u0432 \u043f\u043b\u0430\u043d\u0435 \u0438\u043c\u0435\u043d\u043d\u043e MVVM Toolkit&#8217;a.<\/p>\n<p>\u0417\u0430\u044f\u0432\u043b\u0435\u043d\u043e \u0438\u043d\u0442\u0435\u043d\u0441\u0438\u0432\u043d\u043e\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0439 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043a\u043e\u0434\u0430 (source generators), \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e boilerplate-\u043a\u043e\u0434\u0430.<\/p>\n<details class=\"spoiler\">\n<summary>\u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Commands:<\/summary>\n<div class=\"spoiler__content\">\n<details class=\"spoiler\">\n<summary>\u0431\u044b\u043b\u043e:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">private IRelayCommand&lt;User> greetUserCommand;  public IRelayCommand&lt;User> GreetUserCommand => greetUserCommand ??= new RelayCommand&lt;User>(GreetUser);  private void GreetUser(User user) {     Console.WriteLine($\"Hello {user.Name}!\"); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0441\u0442\u0430\u043b\u043e:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">[RelayCommand] private void GreetUser(User user) {     Console.WriteLine($\"Hello {user.Name}!\"); }<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u043f\u0440\u0438 \u043e\u0431\u044a\u044f\u0432\u043b\u0435\u043d\u0438\u0438 \u0438 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Observable properties:<\/summary>\n<div class=\"spoiler__content\">\n<details class=\"spoiler\">\n<summary>\u0431\u044b\u043b\u043e:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">private string? firstName;  public string? FirstName {     get => firstName;     set     {         if (SetProperty(ref firstName, value))         {             OnPropertyChanged(nameof(FullName));             GreetUserCommand.NotifyCanExecuteChanged();         }     } }  private string? lastName;  public string? LastName {     get => lastName;     set     {         if (SetProperty(ref lastName, value))         {             OnPropertyChanged(nameof(FullName));             GreetUserCommand.NotifyCanExecuteChanged();         }     } }  public string? FullName => $\"{FirstName} {LastName}\";<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<details class=\"spoiler\">\n<summary>\u0441\u0442\u0430\u043b\u043e:<\/summary>\n<div class=\"spoiler__content\">\n<pre><code class=\"cs\">[ObservableProperty] [NotifyPropertyChangedFor(nameof(FullName))] [NotifyCanExecuteChangedFor(nameof(GreetUserCommand))] private string? firstName;  [ObservableProperty] [NotifyPropertyChangedFor(nameof(FullName))] [NotifyCanExecuteChangedFor(nameof(GreetUserCommand))] private string? lastName;  public string? FullName => $\"{FirstName} {LastName}\";<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043f\u0440\u0438 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 <strong>[ObservableProperty]<\/strong> MVVM Toolkit \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u0442 \u0434\u0432\u0430 \u043c\u0435\u0442\u043e\u0434\u0430: <strong>On&lt;PROPERTY_NAME>Changing<\/strong> \u0438 <strong>On&lt;PROPERTY_NAME>Changed<\/strong><\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u0432\u0438\u0434\u0430<\/p>\n<pre><code class=\"cs\">[ObservableProperty] private string name;  partial void OnNameChanging(string name) {     Console.WriteLine($\"The name is about to change to {name}!\"); }  partial void OnNameChanged(string name) {     Console.WriteLine($\"The name just changed to {name}!\"); }<\/code><\/pre>\n<p>\u0440\u0430\u0437\u0432\u0435\u0440\u043d\u0451\u0442\u0441\u044f \u0432<\/p>\n<pre><code class=\"cs\">public string Name {     get => name;     set     {         if (!EqualityComparer&lt;string>.Default.Equals(name, value))         {             OnNameChanging(value);             OnPropertyChanging();             name = value;             OnNameChanged();             OnPropertyChanged();         }     } }  partial void OnNameChanging(string name);  partial void OnNameChanged(string name);<\/code><\/pre>\n<\/p>\n<\/div>\n<\/details>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-the-dotnet-community-toolkit-800\/\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u043e\u043d\u0441.<\/a><\/p>\n<p><a href=\"https:\/\/aka.ms\/toolkit\/docs\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044e.<\/a><\/p>\n<p><a href=\"https:\/\/www.microsoft.com\/store\/apps\/9NKLCF1LVZ5H\" rel=\"noopener noreferrer nofollow\">\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 Microsoft Store.<\/a> <\/p>\n<\/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\/681002\/\"> https:\/\/habr.com\/ru\/articles\/681002\/<\/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-386915","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/386915","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=386915"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/386915\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=386915"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=386915"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=386915"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}