How ashurumaru/educational_practice_wpf_mvvm works
Project Type and Purpose
• This is a Windows desktop application built using WPF (Windows Presentation Foundation) in C#, following the MVVM (Model-View-ViewModel) pattern.
• Purpose: A user management system supporting login/registration, role-based user CRUD, theme selection, and background image loading.
High-Level Architectural Components
a. Presentation Layer (UI)
• Views: XAML windows and user controls under /Views and /CustomControls.
• Styles & Resources: XAML files under /Styles and /Images for theming and backgrounds.
b. Presentation Logic
• ViewModels: Classes under /ViewModels implementing INotifyPropertyChanged and RelayCommand. They receive user events, coordinate commands, expose data for binding.
c. Business & Data Access
• Models:
• UserModel – representation of a user entity
• DataBaseLogicModel – encapsulates EF database operations (login, CRUD).
• ThemeManager – handles loading and switching of themes/background images.
• Configuration: DataBaseConfig.cs holds connection settings; DatabaseQuery.sql for schema.
d. Persistence
• SQL Server database accessed via Entity Framework.
Relationships and Data Flows
• UI Events → ViewModels via Commands (RelayCommand)
• ViewModel Methods → Models for business logic and data access
• DataBaseLogicModel ↔ SQL Server (queries, updates)
• ThemeManager ↔ Local file system (Images folder) to load themes
• ViewModels update bound Views through INotifyPropertyChanged
Architectural Patterns and Principles
• MVVM: clear separation of concerns among Views, ViewModels, and Models.
• Dependency Inversion: ViewModels depend on interfaces of Models (DataBaseLogicModel), not direct database calls.
• Single Responsibility: each folder and class has a distinct role (UI, logic, data access, theming).
Technologies & Frameworks to Annotate
• WPF (XAML) for UI
• C# .NET (educational_practice.sln)
• Entity Framework (DbContext, LINQ) for ORM
• MVVM pattern implemented via BaseViewModel, RelayCommand
• SQL Server as the relational database