Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
17aa861
feat(calendar): add DayViewModel for calendar grid
artcava Feb 14, 2026
c9d1fd7
feat(calendar): add AppointmentSummaryViewModel
artcava Feb 14, 2026
c848b77
feat(calendar): add CalendarViewModel with month navigation and filters
artcava Feb 14, 2026
a38569a
feat(visits): add OperatorCheckboxViewModel for visit form
artcava Feb 14, 2026
fe25acf
feat(visits): add VisitFormViewModel with validation
artcava Feb 14, 2026
a5f070d
feat(calendar): add CalendarView XAML with month grid and appointment…
artcava Feb 14, 2026
1dd24fe
feat(visits): add VisitFormView XAML with validation
artcava Feb 14, 2026
fb25223
feat(converters): add converters for calendar view
artcava Feb 14, 2026
d756497
feat: register CalendarViewModel, VisitFormViewModel and their Views …
artcava Feb 14, 2026
941123b
feat: enable CalendarViewModel navigation in MainViewModel - issue #75
artcava Feb 14, 2026
dc1ea57
test: add comprehensive unit tests for CalendarViewModel - issue #75
artcava Feb 14, 2026
213e9d7
test: add comprehensive unit tests for VisitFormViewModel - issue #75
artcava Feb 14, 2026
a52bc90
fix: add LoadMonthAsync alias for MainViewModel integration - issue #75
artcava Feb 14, 2026
73b4f9e
fix: change VisitFormViewModel to inherit from ObservableValidator fo…
artcava Feb 14, 2026
457084c
fix: update VisitFormViewModelTests to work with ObservableValidator …
artcava Feb 14, 2026
60ea39d
fix: add missing XAML namespaces (d: and mc:) to CalendarView - issue…
artcava Feb 14, 2026
3eb6e7d
fix: add missing XAML namespaces (d: and mc:) to VisitFormView - issu…
artcava Feb 14, 2026
7e7b338
fix: add FluentAssertions package to test project - issue #75
artcava Feb 14, 2026
648fe28
fix: remove unused PTRP.Data.Models namespace from VisitFormViewModel…
artcava Feb 14, 2026
43dbd98
fix: remove unused PTRP.Data.Models namespace from CalendarViewModelT…
artcava Feb 14, 2026
5a3bd5a
fix: replace Spacing with Margin in CalendarView (WPF compatibility) …
artcava Feb 14, 2026
7767eae
fix: replace Spacing with Margin in VisitFormView (WPF compatibility)…
artcava Feb 14, 2026
c14913b
fix: wrap ScrollViewer children in Grid (single child requirement) - …
artcava Feb 14, 2026
07e5398
fix: explicitly validate properties in VisitFormViewModelTests - issu…
artcava Feb 14, 2026
c412fec
feat: add public Validate method for testing - issue #75
artcava Feb 14, 2026
a4442b0
fix: use public Validate() method in tests - issue #75
artcava Feb 14, 2026
09304bb
fix: make NavigateToCalendar async to properly initialize CalendarVie…
artcava Feb 14, 2026
f08040f
fix: add CalendarViewModel mapping to ViewLocator - issue #75
artcava Feb 14, 2026
030e9fb
fix: add missing converters to CalendarView resources - issue #75
artcava Feb 14, 2026
a62f187
fix: use correct converter name InverseBooleanToVisibilityConverter -…
artcava Feb 14, 2026
7dde32e
fix: use Italian culture for month display to fix CI/CD tests - issue…
artcava Feb 14, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/PTRP.App/App.xaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,21 @@
using PTRP.Services;
using PTRP.Services.Interfaces;
using PTRP.ViewModels;
using PTRP.ViewModels.Calendar;
using PTRP.ViewModels.Educators;
using PTRP.ViewModels.Patients;
using PTRP.ViewModels.Projects;
using PTRP.ViewModels.Visits;
using PTRP.Data;
using PTRP.Data.Repositories;
using PTRP.Data.Repositories.Interfaces;
using PTRP.App.Infrastructure;
using PTRP.App.Views.Calendar;
using PTRP.App.Views.Patients;
using PTRP.App.Views.Educators;
using PTRP.App.Views.Projects;
using PTRP.App.Views.Sync;
using PTRP.App.Views.Visits;
using System.IO;
using System.Windows;

Expand Down Expand Up @@ -127,6 +131,8 @@ private void ConfigureServices(ServiceCollection services)
services.AddTransient<EducatorListViewModel>(); // Issue #63: Educator List ViewModel
services.AddTransient<ProjectListViewModel>(); // Issue #64: Project List ViewModel
services.AddTransient<ProjectFormViewModel>(); // Issue #74: Project Form ViewModel
services.AddTransient<CalendarViewModel>(); // Issue #75: Calendar ViewModel
services.AddTransient<VisitFormViewModel>(); // Issue #75: Visit Form ViewModel
services.AddTransient<SyncViewModel>(); // Issue #52: Sync ViewModel
services.AddTransient<ConflictResolutionViewModel>(); // Issue #52: Conflict Resolution ViewModel

Expand All @@ -135,6 +141,8 @@ private void ConfigureServices(ServiceCollection services)
services.AddScoped<PatientListView>(); // Issue #51/#74: Patient List View
services.AddScoped<EducatorListView>(); // Issue #63: Educator List View
services.AddScoped<ProjectListView>(); // Issue #64: Project List View
services.AddScoped<CalendarView>(); // Issue #75: Calendar View
services.AddScoped<VisitFormView>(); // Issue #75: Visit Form View
services.AddScoped<SyncView>(); // Issue #52: Sync View
}

Expand Down
41 changes: 41 additions & 0 deletions src/PTRP.App/Converters/BoolToColorConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;

namespace PTRP.App.Converters;

/// <summary>
/// Converte un booleano in un colore basato su parametro "TrueColor|FalseColor"
/// Esempio: "#007ACC|Transparent" => True = #007ACC, False = Transparent
/// </summary>
public class BoolToColorConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is not bool boolValue)
return Brushes.Transparent;

var param = parameter?.ToString() ?? "Black|Gray";
var colors = param.Split('|');

if (colors.Length != 2)
return Brushes.Transparent;

var targetColor = boolValue ? colors[0] : colors[1];

try
{
return (Brush)new BrushConverter().ConvertFromString(targetColor)!;
}
catch
{
return Brushes.Transparent;
}
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
25 changes: 25 additions & 0 deletions src/PTRP.App/Converters/BoolToFontWeightConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace PTRP.App.Converters;

/// <summary>
/// Converte un booleano in FontWeight (Bold se True, Normal se False)
/// </summary>
public class BoolToFontWeightConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool boolValue && boolValue)
return FontWeights.Bold;

return FontWeights.Normal;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
28 changes: 28 additions & 0 deletions src/PTRP.App/Converters/InverseBooleanToVisibilityConverter.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;

namespace PTRP.App.Converters;

/// <summary>
/// Converte un booleano in Visibility (inverso: False = Visible, True = Collapsed)
/// </summary>
public class InverseBooleanToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is bool boolValue)
return boolValue ? Visibility.Collapsed : Visibility.Visible;

return Visibility.Collapsed;
}

public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is Visibility visibility)
return visibility != Visibility.Visible;

return false;
}
}
5 changes: 5 additions & 0 deletions src/PTRP.App/Infrastructure/ViewLocator.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
using System;
using System.Windows.Controls;
using Microsoft.Extensions.DependencyInjection;
using PTRP.App.Views.Calendar;
using PTRP.App.Views.Educators;
using PTRP.App.Views.Patients;
using PTRP.App.Views.Projects;
using PTRP.App.Views.Setup;
using PTRP.App.Views.Sync;
using PTRP.ViewModels;
using PTRP.ViewModels.Calendar;
using PTRP.ViewModels.Educators;
using PTRP.ViewModels.Patients;
using PTRP.ViewModels.Projects;
Expand Down Expand Up @@ -56,6 +58,9 @@ public ViewLocator(IServiceProvider serviceProvider)
// so it's not navigated to directly - it's opened in dialogs
ProjectFormViewModel => new ProjectFormView(),

// Calendar Module (Issue #75)
CalendarViewModel => _serviceProvider.GetRequiredService<CalendarView>(),

// Sync Module (requires IServiceProvider in constructor)
SyncViewModel => _serviceProvider.GetRequiredService<SyncView>(),

Expand Down
Loading
Loading