3 ms·
Yeah, UWP is a progression on WPF/Silverlight that had its own XAML as part of the platform code/declarative. Xamarin is from Mono and had its own XAML for Xam
by drawkbox 5y ago
Yeah, UWP is a progression on WPF/Silverlight that had its own XAML as part of the platform code/declarative.
Xamarin is from Mono and had its own XAML for Xamarin.Forms that underneath have build in Renderers for platform targets.
Xamarin allows Shared or PCL that can be made for each platform iOS, Android, UWP etc. You can use CustomRenderers for each platform to access the native platforms and write code towards them or use Xamarin.Forms.
Xamarin.Forms is what is being replaced really and the porting to .NET 6 for MAUI, with WinUI for the UWP targets.
Both Xamarin and UWP have differing XAML because they had their own for the platforms they were on, Xamarin from Mono, UWP progression from other Microsoft tech. In a way this version merges that more closely but still can access directly. The default MAUI will use these targets per platform. If you override one you can implement it in direct platform. Xamarin is really just an abstraction around the platforms and some shared controls that have pre-baked renderers that do that for you.
I don't really use XAML much though other than a stub to load Main, everything is done in code usually. Same way I build native apps directly, mostly code except where not possible or the team needs to edit them. For Xamarin I use Shared setup where I can use Xamarin.Forms (and soon MAUI) for ContentPages/Controls but where needed you can still use a CustomRenderer and override a control or access some properties that you want to edit, or create entire controls/sets that aren't shared across all targets as Xamarin creates a baseline between them and renders how each platform does. In those custom scenarios you might use UWP/WinUI if targeting UWP. If targeting iOS/Android it may be UIKit/Foundation or Android the Android libs Views/Graphics/Content etc.
The Shared [1][2] setup and Xamarin.Forms or coming MAUI allow you to quickly get the app running on all platforms and then you can adjust as needed for specifics. Or do the whole thing natively per platform with custom and just manage it from Xamarin. It is flexible and great for prototypes quick and getting those to something that is shippable. The Shared setup this way is similar to the handler approach in MAUI where underneath the shared abstraction controls are converted into platform specific but you can do custom ones to override or combine controls.
[1] https://docs.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/code-sharing https://docs.microsoft.com/en-us/xamarin/cross-platform/app-...
[2] https://docs.microsoft.com/en-us/xamarin/cross-platform/app-fundamentals/shared-projects?tabs=macos https://docs.microsoft.com/en-us/xamarin/cross-platform/app-...