Trenini App: Building a Cross-Platform Train Schedule Manager with .NET MAUI

Giovanni Mugelli
Giovanni Mugelli

A mobile app that brings order to Italy's notoriously complex regional rail timetables. Built with .NET MAUI, C#, and the MVVM pattern — running natively on iOS and Android from a single codebase.

Italy has some of the most scenic rail routes in the world. It also has some of the most confusing timetables. Regional trains, high-speed intercity lines, and local commuter services all operate on different schedules — sometimes published across multiple sources with inconsistent formats. Trenini App is my attempt to bring a little order to that chaos.

The name is intentionally affectionate. Trenini means "little trains" in Italian — the kind you played with as a child. It carries the same warmth I wanted the app itself to have.

Why .NET MAUI?

I had been working primarily in web technologies and Flutter, and I was curious about Microsoft's answer to cross-platform mobile development. .NET MAUI (Multi-platform App UI) is the successor to Xamarin.Forms, introduced as part of the .NET 6 unified platform. It compiles to native iOS and Android applications from a single C# codebase, with platform-specific renderers that adapt to each OS's native controls.

The appeal is significant: if you already live in the .NET ecosystem — and I do, through years of .NET Core and C# work on backend systems — then MAUI lets you bring those skills directly to mobile without context-switching to a different language and paradigm.

Architecture: MVVM Done Right

The app is structured around the Model-View-ViewModel pattern, which is the idiomatic architecture for MAUI applications. Each screen has a corresponding ViewModel that exposes observable properties and commands. The Views bind declaratively to these properties — no code-behind, no imperative UI manipulation.

The project structure reflects this cleanly:

  • Models/ — train schedule data types, route entities, timetable entries
  • ViewModels/ — one ViewModel per screen, handling state and business logic
  • Pages/ — XAML pages that bind to ViewModels
  • Services/ — data access layer, schedule parsing, network calls
  • Behaviors/ — custom XAML behaviors, including a HapticFeedbackBehavior that triggers haptic responses on user interactions
  • Extensions/ — C# extension methods for cleaner, more expressive code

Haptic Feedback and Native Feel

One of the details I invested time in was haptic feedback. On iOS especially, users have come to expect physical confirmation of UI interactions — a subtle tap when selecting a departure time, a slightly stronger pulse when a train connection is missed. The HapticFeedbackBehavior class encapsulates this logic as a reusable XAML behavior, keeping the ViewModels free of platform concerns.

Getting haptic feedback right in MAUI required understanding the platform abstraction layer. MAUI provides a HapticFeedback API in the Microsoft.Maui.Devices namespace, but the nuances of intensity and pattern differ between iOS and Android. The behavior handles this gracefully with platform conditionals.

What I Learned About MAUI

MAUI is a genuinely capable framework, but it is younger than Flutter and the tooling shows it. Hot reload for XAML can be unreliable. Some third-party packages have not fully caught up from Xamarin.Forms. The debugging experience on iOS simulators is excellent; on Android emulators, there is more friction.

That said, the productivity gains from writing in C# — a language I know deeply — more than compensated. The type system, the LINQ query expressions for filtering timetables, the async/await model for network calls: all of it felt immediately natural.

Status and Roadmap

The project is under active development. Current features include timetable browsing, favourite routes, and offline caching of recently viewed schedules. On the roadmap: real-time delay data from the Trenitalia API, push notifications for departure reminders, and a widget for the iOS home screen.

The source code is available on GitHub.