First off, thank you for considering contributing to WPFBase! It's people like you that make WPFBase such a great framework.
By participating in this project, you are expected to uphold our simple code of conduct:
- Be respectful and inclusive
- Welcome newcomers and help them get started
- Focus on constructive criticism
- Accept feedback gracefully
Before creating bug reports, please check existing issues as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible using our bug report template.
Great Bug Reports tend to have:
- A quick summary and/or background
- Steps to reproduce
- Be specific!
- Give sample code if you can
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening, or stuff you tried that didn't work)
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please use the feature request template and include:
- A clear and descriptive title
- A detailed description of the proposed feature
- Code examples of how the feature would be used
- Explain why this enhancement would be useful
- Fork the repo and create your branch from
main - Follow the existing code style - We use modern C# with CommunityToolkit.Mvvm patterns
- Add tests if you've added code that should be tested
- Ensure the test suite passes - Run
dotnet test - Update documentation - Make sure the README.md and relevant folder READMEs are updated
- Write a good commit message - Follow conventional commits if possible
-
Prerequisites
- .NET 9.0 SDK
- Visual Studio 2022 / VS Code / Rider
- Git
-
Getting Started
git clone https://github.com/DrMojorisin/ClaudeWPF.git cd ClaudeWPF dotnet restore dotnet build dotnet test
-
Project Structure
- Follow the existing folder structure
- Each folder has a README explaining its purpose
- Keep related code together
-
Use Modern Patterns
// ✅ Good - Modern pattern [ObservableProperty] private string name = string.Empty; // ❌ Avoid - Old pattern private string _name; public string Name { get => _name; set => SetProperty(ref _name, value); }
-
Dependency Injection
- Define interfaces in
/Interfaces - Implement in
/Services - Register in
App.xaml.cs
- Define interfaces in
-
MVVM Pattern
- ViewModels inherit from
ViewModelBase - Use
[RelayCommand]for commands - Keep Views simple with minimal code-behind
- ViewModels inherit from
-
Async/Await
// Always use async/await for I/O operations [RelayCommand] private async Task LoadDataAsync() { IsBusy = true; try { await DataService.LoadAsync(); } finally { IsBusy = false; } }
-
Error Handling
- Use try-catch in commands
- Log errors with ILoggingService
- Show user-friendly messages with IDialogService
- Add XML comments to public APIs
- Update folder README files when adding new components
- Include usage examples in documentation
- Keep the GETTING_STARTED.md up to date
-
Unit Tests Required For:
- All services
- ViewModels with business logic
- Converters and validators
- Extension methods
-
Test Naming Convention:
[Fact] public async Task MethodName_StateUnderTest_ExpectedBehavior() { // Arrange // Act // Assert }
-
Use Mocking:
var mockDialog = new Mock<IDialogService>(); mockDialog.Setup(x => x.ShowInformationAsync(It.IsAny<string>(), It.IsAny<string>())) .ReturnsAsync(true);
We prefer conventional commits but it's not required:
feat:New featurefix:Bug fixdocs:Documentation changesstyle:Code style changes (formatting, etc)refactor:Code refactoringtest:Test additions or changeschore:Maintenance tasks
Example:
feat: add dark mode support to theme service
- Implemented dark theme resources
- Added theme toggle command
- Updated documentation
- Automated checks must pass (build, tests)
- Code review by maintainers
- Documentation must be updated
- Tests must be included for new features
- Documentation: Start with README.md and GETTING_STARTED.md
- Issues: Check existing issues or create a new one
- Discussions: Use GitHub Discussions for questions
- Code Examples: Look at existing implementations in the codebase
Contributors will be recognized in:
- GitHub contributors page
- Release notes for significant contributions
- Special mentions for exceptional contributions
By contributing, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to WPFBase! 🎉