A modern WPF calculator application built with C# featuring a clean interface and MVVM architecture for basic arithmetic operations.
- Basic Arithmetic Operations: Addition, subtraction, multiplication, and division
- MVVM Architecture: Clean separation of concerns with ViewModel pattern
- Command Pattern: Responsive button interactions using command binding
- Modern WPF UI: Clean and intuitive user interface design
- Operator Management: Structured arithmetic operation handling
- Real-time Calculation: Instant results as you input numbers
- Framework: .NET WPF (Windows Presentation Foundation)
- Language: C#
- Architecture: MVVM (Model-View-ViewModel)
- Design Pattern: Command Pattern
- IDE: Visual Studio
- Windows 10 or later
- .NET Framework 4.7.2 or later
- Visual Studio 2019 or later (for development)
-
Clone the repository:
git clone https://github.com/AdamTroyan/Calculator.git
-
Open the solution file in Visual Studio:
Calculator.sln -
Build and run the application:
- Press
F5to run in debug mode - Or press
Ctrl+F5to run without debugging
- Press
- Launch the calculator application
- Click number buttons to input values
- Click operation buttons (+, -, ×, ÷) to perform calculations
- Press equals (=) to see the result
- Use Clear (C) to reset the calculator
Calculator/
├── App.xaml # Application configuration
├── App.xaml.cs # Application startup logic
├── MainWindow.xaml # Main calculator UI layout
├── MainWindow.xaml.cs # Main window logic
├── AssemblyInfo.cs # Assembly metadata
├── Calculator.csproj # Project configuration
├── Calculator.sln # Solution file
├── Command/
│ └── ButtonPressedCommand.cs # Command pattern implementation
├── ModelManager/
│ └── MainViewModel.cs # MVVM ViewModel logic
└── OperatorManager/
└── ArithmeticOperators.cs # Arithmetic operation handling
- Model: Arithmetic operations and calculation logic
- View: XAML UI components and layout
- ViewModel: Data binding and command handling
- Button interactions handled through command binding
- Centralized command execution logic
- Responsive UI feedback
- MainViewModel: Central data binding and state management
- ButtonPressedCommand: Handles all button click operations
- ArithmeticOperators: Manages calculation logic and operations
- MainWindow: Primary user interface and display
- Fork the repository
- Create a 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
This project is licensed under the MIT License - see the LICENSE file for details.
Adam Troyan - GitHub Profile
Built with ❤️ for simple and effective calculations