Vending Machine

Vending Machine is a WPF and C# simulator that emulates vending machine operations, including coin insertion and product selection. Accessible via AWS AppStream 2.0 for cross-platform use.

Release Date: March 2nd, 2023

Link: Vending Machine Streaming Version

Project Details

Introduction

A highly interactive Vending Machine Simulator built using WPF and C#. This simulator emulates the real-world operation of a vending machine, allowing users to insert coins, select products, and receive change.

Functionalities

Custom User Interface: Designed to replicate the look and feel of an actual vending machine, the simulator includes custom-styled buttons and displays for product selection and coin insertion. Service Features: Service and power-off functionalities are incorporated for administrative purposes, such as restocking and machine maintenance. Dynamic Resource Management: Utilizes resource dictionaries for managing brushes and strings, streamlining the process of UI customization and localization. Control Styles: Implements custom styles and triggers for UI elements, enhancing user interaction through visual feedback. User Controls: Incorporates UserControls for modular design, facilitating the reuse of components like the coin display. Data Binding: Leverages the powerful data binding capabilities of WPF, binding UI elements to ViewModel properties to separate the presentation from the logic. ListViews and Grids: Employs a ListView presented as a grid to display coin contents, providing a clear and organized view of machine inventory.

Development Process

The simulator was developed as an assignment focused on enhancing XAML skills. This included creating and applying custom styles, merging resource dictionaries, creating UserControls, and applying the MVVM pattern to bind a ViewModel to a View.

Exercise Highlights

Custom Styles and Resources: Defined explicit and implicit styles for buttons and applied brush resources for UI color customization. Enhanced UI Interaction: Improved the MainWindow with a service row of buttons and a coin return button with MouseOver effects. ViewModel Implementation: Developed a ViewModel for the coin display, illustrating the contents of the main and temporary coin boxes.

System Requirements

  • Platform: Accessible via browser on AWS AppStream 2.0, compatible with Windows and MacOS.
  • Framework: Built with .NET Core and optimized for WPF.

2024