How rjcodeadvance/login-in-wpf-mvvm-c-sharp-and-sql-server works
Main Components
• Presentation Layer: This includes all WPF elements such as Views (LoginView.xaml, MainView.xaml) and the Custom Controls (BindablePasswordBox). Mark these as the “UI / View” components.
• ViewModels: Represented by the LoginViewModel, MainViewModel, and the associated ViewModelBase and ViewModelCommand elements. These orchestrate the logic and mediate between the UI and the business/data layers.
• Models: These include UserModel, UserAccountModel, and the IUserRepository interface. They represent the data and business rules.
• Data Access / Repository Layer: Consisting of RepositoryBase and UserRepository which handle interactions with the SQL Server database via the MVVMLoginDb.sql script.
• Application Configuration: Files like App.xaml/App.config declare application startup procedures and configurations.
• SQL Server Backend: Represented externally by the MVVMLoginDb.sql file, which sets up the database schema and any necessary stored procedures.
Relationships and Interactions
• Optionally, include configuration and startup elements (i.e., App.xaml) as the project’s entry point that loads the initial View and ViewModel.
Architectural Patterns and Design Principles
• That the project follows the MVVM pattern by segregating the UI, ViewModel, and Model layers.
• How dependency injection or service location might be used (if it is implicit) to link the repositories to the view models.
• Separation of concerns, where the UI is decoupled from business logic and data handling.