Alinear BD local con esquema de produccion, login offline y publicacion portable
- Modelos renombrados para coincidir con columnas de MariaDB (ApPaterno/ApMaterno, HoraSalida, FechaFin, IdAsistenciaProfesor) - Agregado campo IdAlumno a DetalleContrato - Seed data con IDs reales de produccion (16451, 16493, profesor 15668563-1) - Login offline: solo valida RUT contra BD local, sin contraseña - ConnectivityService: checkea internet al inicio, bloquea si hay conexion - ViewLocator corregido: busca tipos en todos los ensamblados - Todos los ViewModels heredan de ViewModelBase - Publicacion self-contained para win-x64, linux-x64, osx-x64, osx-arm64 - Agregado .gitignore, removidos bin/obj/publish del tracking
This commit is contained in:
1 parent
9068122b6b
commit
fb275508ee
19 files changed
+196
-77
No files matched your search
@@ -1,14 +1,12 @@
|
||||
using System;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Controls.Templates;
|
||||
using Asistencia.ViewModels;
|
||||
|
||||
namespace Asistencia;
|
||||
|
||||
/// <summary>
|
||||
/// Given a view model, returns the corresponding view if possible.
|
||||
/// </summary>
|
||||
[RequiresUnreferencedCode(
|
||||
"Default implementation of ViewLocator involves reflection which may be trimmed away.",
|
||||
Url = "https://docs.avaloniaui.net/docs/concepts/view-locator")]
|
||||
@@ -18,15 +16,17 @@ public class ViewLocator : IDataTemplate
|
||||
{
|
||||
if (param is null)
|
||||
return null;
|
||||
|
||||
|
||||
var name = param.GetType().FullName!.Replace("ViewModel", "View", StringComparison.Ordinal);
|
||||
var type = Type.GetType(name);
|
||||
var type = AppDomain.CurrentDomain.GetAssemblies()
|
||||
.Select(a => a.GetType(name))
|
||||
.FirstOrDefault(t => t != null);
|
||||
|
||||
if (type != null)
|
||||
{
|
||||
return (Control)Activator.CreateInstance(type)!;
|
||||
}
|
||||
|
||||
|
||||
return new TextBlock { Text = "Not Found: " + name };
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user