The promise of writing one codebase and running it everywhere has never really panned out for developers. However, using XAML and .NET MAUI, you come much closer. .NET MAUI is described by Microsoft ...
Microsoft's .NET MAUI (Multi-platform App UI) is the next-gen evolution of the mobile-centric Xamarin.Forms that adds desktop app support, which has just been formally introduced in .NET 6 Preview 3.