Question About A .Net MAUI App Solution Structure #7911
Replies: 2 comments 3 replies
-
I am no contributor nor member of MAUI team, but from what I have seen, programmers already encountered this problem before. |
Beta Was this translation helpful? Give feedback.
-
MAUI solve difference platform use like MainPage.iOS.cs, MainPage.Windows.cs, see https://github.com/dotnet/maui/tree/main/src/Core/src/Handlers/Border , it define a https://github.com/dotnet/maui/blob/main/.nuspec/Microsoft.Maui.Controls.MultiTargeting.targets used in .csproj. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm working on a Project Management constuction app. It has a WPF Desktop project and a Xamarin Forms tablet project In the same solution.
The WPF app has views specific to the desktop app, and the Xamarin Forms project has views that are specific to the tablet. But both projects shared a lot of common things, like View Models, Data Models, Enums, Services, API proxy, etc.
For example, the Xamarin Login View is entirely different then the Desktop Login View. Yet the common LoginViewModel works for both. The Desktop app has a Project View, but the Xamarin Forms project has a small subset in a smaller view. They share a VM also.
The point here is that the Desktop parts are in a WPF project, and the mobile parts are in an Xamarin Forms project.
With .Net MAUI, there is only one project. It seems to me you can't possibly write a "shared" view that would work in both targets. And even if you could, you would almost certainly need #IF/#ELSE scattered all over to decide what view to show depending on what target you're running on.
So, what I'm looking for here is a clearer understanding of how a .Net MAUI app is structured.
Thanks
Beta Was this translation helpful? Give feedback.
All reactions