A modern, open-source Windows calculator built with WinUI 3, featuring MVVM architecture, Fluent Design System, and full keyboard support.
- 🧮 Full Calculator Operations - Addition, subtraction, multiplication, division, percentage
- 🔢 Advanced Functions - Square root, square, reciprocal, negate
- ⌨️ Complete Keyboard Support - Use numpad or keyboard for fast input
- 🎨 Fluent Design - Electric Blue accent with Mica backdrop
- 🌙 Dark/Light Theme - Follows Windows system theme automatically
- ♿ Accessible - Full keyboard navigation, screen reader support
- 📋 Clipboard Integration - Right-click to copy results
Coming soon
- Windows 10 (1809+) or Windows 11
- .NET 9.0 SDK
- Windows App SDK
git clone https://github.com/YOUR_USERNAME/winui-calculator.git
cd winui-calculatordotnet build
dotnet rundotnet test calculator.Testscalculator/
├── Commands/
│ └── RelayCommand.cs # ICommand implementation for MVVM
├── Helpers/
│ └── ServiceLocator.cs # Lightweight dependency injection
├── Services/
│ ├── ICalculatorEngine.cs # Calculator logic interface
│ └── CalculatorEngine.cs # Math operations implementation
├── ViewModels/
│ └── CalculatorViewModel.cs # Main ViewModel with all commands
├── Styles/
│ └── CalculatorStyles.xaml # Button styles, animations, colors
├── Views/
│ ├── MainPage.xaml # Calculator UI layout
│ └── MainPage.xaml.cs # Keyboard handling
├── calculator.Tests/ # Unit tests (xUnit)
├── App.xaml # Resource dictionary references
└── App.xaml.cs # Window configuration, Mica backdrop
This project follows the MVVM (Model-View-ViewModel) pattern:
- Model:
CalculatorEnginehandles all mathematical operations - ViewModel:
CalculatorViewModelmanages UI state and commands - View:
MainPage.xamldefines the calculator UI
┌─────────────┐ ┌──────────────────┐ ┌──────────────────┐
│ MainPage │────▶│CalculatorViewModel│────▶│ CalculatorEngine │
│ (View) │ │ (ViewModel) │ │ (Service) │
└─────────────┘ └──────────────────┘ └──────────────────┘
│ │
│ x:Bind │ ICommand
└──────────────────────┘
| Key | Action |
|---|---|
0-9 |
Enter digits |
. |
Decimal point |
+ |
Add |
- |
Subtract |
* |
Multiply |
/ |
Divide |
Enter |
Calculate result |
Backspace |
Delete last digit |
Escape |
Clear all |
Delete |
Clear entry |
Ctrl+C |
Copy result |
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
- Follow MVVM pattern
- Add unit tests for new calculator operations
- Use Fluent Design guidelines for UI changes
- Ensure accessibility (AutomationProperties, keyboard navigation)
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with WinUI 3
- Inspired by the Windows Calculator
- Icons from Segoe Fluent Icons