Replies: 1 comment 7 replies
-
Flutter has shown this? What? WPF was first by a wide margin. And it's a Microsoft tech led by the .NET team. How so much has been forgotten... Xamarin Forms is the one that went backwards to the days of Windows Forms and forgot what XAML UI frameworks were supposed to be. Your example of a Text property on Button is a good one and shows how poor the design was from the start. As a Microsoft project I think this should be architected more on WPF/UWP ideas than Fluttter. That's what the dev community is already familiar with (or at least should be). |
Beta Was this translation helpful? Give feedback.
-
Flutter has shown that the composite design pattern can be a very powerful tool for creating user interfaces.
The key concept is that every higher level control is build from other controls and that all child controls can be replaced.
Primitive controls are the ones that contain lower level code, e.g. code to draw on canvas.
A common "mistake", for example, is a
Button
control with astring
property for text. This immediately cripples customization of the button control. If type of this property is changed to be a base control, then developer can use eitherLabel
orImage
control or any layout control or any custom control to be placed inside the button. So this button control is flexible enough to be a text button or image button or any other clickable control.This pattern lends itself to easily and quickly create custom controls from basic controls or to completely transform existing complex controls (which is hard to do without an arhitecture like this).
In flutter, there are some places, where composition of widgets is somehow broken:
How and what kind of information propagates through the tree (e.g. user input events, default styling...) is also an important design consideration.
What are MAUI's design goals regarding composition? I know some composition was already possible in Xamarin.Forms, but it wasn't a core element of the arhitecture, because controls relied on native controls. But since Maui.Graphics.Controls don't rely on native controls, is there any special focus on this pattern now (like with Flutter's "everything is a widget")?
IMO, this is a powerful arhitecture.
(Note, that this is only intended as discussion of possible design arhitecture which has both pros and cons. I haven't used Maui.Graphic.Controls yet, so I don't know how much it already aligns with discussed arhitecture, but from my experience many UI frameworks (for various reasons) fail to implement this well)
Beta Was this translation helpful? Give feedback.
All reactions