Skip to content

AdamTroyan/Calculator

Repository files navigation

Calculator

A modern WPF calculator application built with C# featuring a clean interface and MVVM architecture for basic arithmetic operations.

🚀 Features

  • 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

🛠️ Technologies

  • Framework: .NET WPF (Windows Presentation Foundation)
  • Language: C#
  • Architecture: MVVM (Model-View-ViewModel)
  • Design Pattern: Command Pattern
  • IDE: Visual Studio

📋 Requirements

  • Windows 10 or later
  • .NET Framework 4.7.2 or later
  • Visual Studio 2019 or later (for development)

🚀 Getting Started

Installation

  1. Clone the repository:

    git clone https://github.com/AdamTroyan/Calculator.git
  2. Open the solution file in Visual Studio:

    Calculator.sln
    
  3. Build and run the application:

    • Press F5 to run in debug mode
    • Or press Ctrl+F5 to run without debugging

Usage

  1. Launch the calculator application
  2. Click number buttons to input values
  3. Click operation buttons (+, -, ×, ÷) to perform calculations
  4. Press equals (=) to see the result
  5. Use Clear (C) to reset the calculator

📁 Project Structure

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

🎯 Architecture

MVVM Pattern

  • Model: Arithmetic operations and calculation logic
  • View: XAML UI components and layout
  • ViewModel: Data binding and command handling

Command Pattern

  • Button interactions handled through command binding
  • Centralized command execution logic
  • Responsive UI feedback

⚙️ Key Components

  • 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

🤝 Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the MIT License - see the LICENSE file for details.

👨‍💻 Author

Adam Troyan - GitHub Profile


Built with ❤️ for simple and effective calculations

About

Just a cute calculator I made as my first project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages