Page with code-behind handling both UI logic and data operations.
High-level architecture
The application does not use a full MVVM framework. Instead it adopts a MVVM-lite style:- View — XAML pages and dialogs define the UI and use
{Binding}expressions. - Model — Plain C# classes (e.g.,
Profesor,FilaAula) declared inside each page’s code-behind file. - Controller logic in code-behind — Each
Pageclass handles data loading, CRUD operations, and navigation events directly. There are no separate ViewModel classes.
Single solution
AppAdministrativa.sln contains one project. All XAML pages, dialogs, models, and assets live in the same project root.SQLite data store
Schedule data is persisted in
horarios.db via System.Data.SQLite.EF6. All other modules use in-memory ObservableCollection<T> that is seeded with sample data at startup.Application startup flow
App.xamlsetsStartupUritoMainWindow.xaml, which is the login screen.MainWindowauthenticates the user with a photo-image login mechanism. On success it opensMenuPrincipal.MenuPrincipalis the application shell. It contains a collapsible sidebar and an innerFramecontrol namedFrameSecundario.- Each sidebar menu item navigates
FrameSecundarioto the corresponding modulePage.
Navigation pattern
Navigation is frame-based.MenuPrincipal.xaml hosts a Frame element:
Module structure
Every management module follows the same two-file pattern:| File | Purpose |
|---|---|
MyModule.xaml / .cs | Page with a DataGrid, search filter, and Add / Edit / Delete buttons |
AgregarMyModuleWindow.xaml / .cs | Modal Window dialog for creating and editing a single record |
ObservableCollection<T> that backs the DataGrid. The dialog exposes a NuevoItem property that the page reads after ShowDialog() returns.
The
Camaras module is an exception — it does not have an Agregar*Window dialog because cameras are monitored, not manually created.Data layer
In-memory collections
Most modules store their data in anObservableCollection<T> declared in code-behind. Data is seeded via a CargarDatosDePrueba() method called from the page constructor:
SQLite (schedules)
TheHorarios module persists schedule records in horarios.db using System.Data.SQLite.EF6. The database file is included in the project and configured to copy to the output directory on every build:
UI pattern
- All layouts are defined in XAML. Code-behind does not construct UI elements programmatically except for color changes on the sidebar.
DataGridcontrols useItemsSourcebinding to anObservableCollection<T>. BecauseObservableCollection<T>raises change notifications, adding or removing items automatically refreshes the grid.- Modal dialogs use
ShowDialog()and return data through a public property on the dialog class. - Search / filter logic runs on
TextChangedevents by iterating the collection and applyingDataGrid.Items.Filter.
Dependencies
| Package | Version | Purpose |
|---|---|---|
.NET 8 (net8.0-windows) | 8.x | Runtime and WPF framework |
SQLitePCLRaw.core | 3.0.2 | Low-level SQLite bindings |
System.Data.SQLite.EF6 | 2.0.3 | ADO.NET / EF6 provider for SQLite |