mvvm-toolkit
यह क्या करती है
यह टूल प्रोग्रामर्स को ऐप्स के लिए कोड ज़्यादा तेज़ी से लिखने में मदद करता है। यह यूज़र इंटरफ़ेस और commands बनाने के दोहराव वाले हिस्सों को अपने आप करता है, जिससे डेवलपमेंट तेज़ और कम गलतियों वाला होता है।
कब इस्तेमाल करें
- ✓किसी ऐप में display logic (ViewModel) बनाते या उसकी समीक्षा करते समय।
- ✓जब आपको ऐसे बटन या कार्य परिभाषित करने हों जिन्हें यूज़र कर सके।
- ✓जब यूज़र द्वारा फ़ॉर्म में डाली गई जानकारी की जांच (validate) करनी हो।
Skill का लिंक
https://github.com/github/awesome-copilot/blob/main/skills/mvvm-toolkit/SKILL.mdइसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।
कैसे इस्तेमाल करें
सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।
पेस्ट करने के लिए तैयार मैसेज
Claude Code, Codex या Cursor के लिए: प्रोजेक्ट फ़ोल्डर में चलाएँ और skill इंस्टॉल हो जाएगी।
SKILL.md डाउनलोड करें और अपने एजेंट के skills फ़ोल्डर में रखें।
AI से क्या माँगें: उदाहरण
“मैं ऐसा बटन कैसे बनाऊं जो यूज़र का डेटा सेव करे और सिर्फ़ तभी काम करे जब नाम वाला फ़ील्ड खाली न हो?”
हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।
यह कैसे काम करती है
यह टूल 'code generators' का इस्तेमाल करता है, जो प्रोग्रामर द्वारा जोड़े गए सरल annotations के आधार पर अपने आप अतिरिक्त कोड बनाते हैं। इससे प्रोग्रामर को बहुत सा दोहराव वाला कोड हाथ से नहीं लिखना पड़ता।
तकनीकी सामग्री (मूल SKILL.md)
लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।
CommunityToolkit.Mvvm (core)
Use this skill when authoring or reviewing ViewModels, properties,
commands, or validation in apps that use CommunityToolkit.Mvvm 8.x.
Companion skills. Load
mvvm-toolkit-messengerforIMessengerpub/sub patterns. Loadmvvm-toolkit-diforMicrosoft.Extensions.DependencyInjectionintegration.
Quick recap.
[ObservableProperty]on private fields inpartialclasses;[RelayCommand]on instance methods; inherit fromObservableObject(orObservableValidatorfor input forms,ObservableRecipientwhen usingIMessenger).
Package & setup
<ItemGroup>
<PackageReference Include="CommunityToolkit.Mvvm" Version="8.*" />
</ItemGroup>
Targets: netstandard2.0, netstandard2.1, net6.0+. Works on .NET, .NET
Framework, Mono. Source generators ship in the same NuGet — no extra
analyzer reference required.
Namespaces:
using CommunityToolkit.Mvvm.ComponentModel; // ObservableObject, [ObservableProperty]
using CommunityToolkit.Mvvm.Input; // [RelayCommand], RelayCommand, AsyncRelayCommand
Universal rule. Every type that uses
[ObservableProperty]or[RelayCommand]— and every enclosing type, if nested — must be declaredpartial. Without it, the generators emitMVVMTK0008/MVVMTK0042.
Source generators cheat sheet
| Attribute | Applied to | Generates |
|---|---|---|
[ObservableProperty] |
private field | Public INotifyPropertyChanged property + OnXxxChanging/OnXxxChanged partial-method hooks |
[NotifyPropertyChangedFor(nameof(Other))] |
observable field | Also raises PropertyChanged for the listed property |
[NotifyCanExecuteChangedFor(nameof(MyCommand))] |
observable field | Calls MyCommand.NotifyCanExecuteChanged() on change |
[NotifyDataErrorInfo] |
observable field on ObservableValidator |
Calls ValidateProperty(value) from the setter |
[NotifyPropertyChangedRecipients] |
observable field on ObservableRecipient |
Broadcast(old, new) after the change |
[RelayCommand] |
instance method | Lazy RelayCommand / AsyncRelayCommand exposed as IRelayCommand / IAsyncRelayCommand |
[RelayCommand(CanExecute = nameof(CanX))] |
instance method | Wires CanExecute to a method or property |
[RelayCommand(IncludeCancelCommand = true)] |
async method with CancellationToken |
Also generates XxxCancelCommand |
[RelayCommand(AllowConcurrentExecutions = true)] |
async method | Allows queued/parallel invocations (default disables while running) |
[RelayCommand(FlowExceptionsToTaskScheduler = true)] |
async method | Surfaces exceptions via ExecutionTask instead of awaiting and rethrowing |
[property: SomeAttr] |
observable field or [RelayCommand] method |
Forwards SomeAttr onto the generated property (e.g., [JsonIgnore]) |
Naming. Field name / _name / m_name → Name. Method LoadAsync →
LoadCommand (the Async suffix is stripped; a leading On is also
stripped).
See references/source-generators.md for
the full attribute reference with generated-code samples.
ViewModel patterns
Simple observable property
public partial class ContactViewModel : ObservableObject
{
[ObservableProperty]
private string? name;
}
Hooks: OnXxxChanging / OnXxxChanged
[ObservableProperty]
private string? name;
partial void OnNameChanged(string? value) =>
Logger.LogInformation("Name changed to {Name}", value);
Both single-arg (value) and two-arg (oldValue, newValue) overloads
are available. Implement only the ones you need; unimplemented hooks are
elided by the compiler (zero runtime cost).
Dependent properties + dependent commands
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(FullName))]
[NotifyCanExecuteChangedFor(nameof(SaveCommand))]
private string? firstName;
[ObservableProperty]
[NotifyPropertyChangedFor(nameof(FullName))]
[NotifyCanExecuteChangedFor(nameof(SaveCommand))]
private string? lastName;
public string FullName => $"{FirstName} {LastName}".Trim();
Wrapping a non-observable model
public sealed class ObservableUser(User user) : ObservableObject
{
public string Name
{
get => user.Name;
set => SetProperty(user.Name, value, user, (u, n) => u.Name = n);
}
}
…
अक्सर पूछे जाने वाले सवाल
क्या मुझे कुछ अतिरिक्त इंस्टॉल करना होगा?
नहीं, मुख्य टूल `CommunityToolkit.Mvvm` package के इंस्टॉल होने के साथ ही आ जाता है।
'code generators' क्या होते हैं?
ये ऐसे टूल हैं जो आपके दिए निर्देशों के आधार पर अपने आप कोड लिखते हैं। ये दोहराव वाला कोड लिखने से बचाते हैं।
`ObservableObject` की जगह `ObservableValidator` कब इस्तेमाल करें?
जब आपके ऐप को फ़ॉर्म में यूज़र द्वारा डाली गई जानकारी की जांच करनी हो, जैसे यह देखना कि ज़रूरी फ़ील्ड भरा गया है या नहीं, तब `ObservableValidator` इस्तेमाल करें।
जानकारी
लेखक का मूल विवरण
CommunityToolkit.Mvvm (the MVVM Toolkit) core: source generators ([ObservableProperty], [RelayCommand], [NotifyPropertyChangedFor], [NotifyCanExecuteChangedFor], [NotifyDataErrorInfo]), base classes (ObservableObject / ObservableValidator / ObservableRecipient), commands (RelayCommand / AsyncRelayCommand), and validation. Companion skills: mvvm-toolkit-messenger for pub/sub, mvvm-toolkit-di for Mi
repo: github/awesome-copilot
लोकप्रियता
- GitHub स्टार
- 40k
- रैंकिंग में स्थान
- #7304
- लाइसेंस
- MIT
- अपडेट की गई
- 15/10/2026
कमेंट
- …
इस repository की और skills
acquire-codebase-knowledge
40kआपके एजेंट को किसी मौजूदा code प्रोजेक्ट को समझने और उसका documentation बनाने में मदद करता है। यह नए लोगों को प्रोजेक्ट से जोड़ने या architecture का सार जानने में उपयोगी है।
acreadiness-assess
40kआपके एजेंट को किसी प्रोजेक्ट की AI के लिए तैयारी जाँचने और रिपोर्ट बनाने देता है। यह समझने में उपयोगी है कि प्रोजेक्ट AI tools इस्तेमाल करने के लिए कितना तैयार है।
acreadiness-generate-instructions
40kआपके एजेंट को assessment के आधार पर AI tools के लिए निर्देश बनाने में मदद करता है। यह बताता है कि AI कोड के साथ बेहतर कैसे काम करे और पहचानी गई कमियाँ कैसे दूर हों।
acreadiness-policy
40kआपके एजेंट को AI प्रोजेक्ट assessment के लिए नीतियाँ तय करने या लागू करने में मदद करता है। यह प्रोजेक्ट्स के मूल्यांकन को मानक बनाने और compliance सुनिश्चित करने में उपयोगी है।
मिलती-जुलती skills
api-connector-builder
280kयह आपके एजेंट को मौजूदा pattern के हिसाब से नए API connections बनाने देता है। जब बिना कोई नया तरीका बनाए एक और integration जोड़ना हो, तब इसका इस्तेमाल करें।
api-design
280kयह आपके एजेंट को best practices के हिसाब से REST APIs डिज़ाइन करने में मदद करता है। यह तय करने में काम आता है कि APIs आपस में कैसे बात करें, errors कैसे दिखें, और data को कैसे व्यवस्थित करें।
backend-patterns
280kआपके एजेंट को server-side architecture patterns और database optimization में मदद करता है। server पर चलने वाला code बनाने या review करने के लिए उपयोगी है।