[Enhancement] Make all controls fully customizable like in WPF or UWP #185
Replies: 4 comments 1 reply
-
While i agree on full customization of every control i think we need first a super-optimized layout system that can support this (maybe a skia backend fully customizable in addition to the "native" one?). Using a ControlTemplate for every single control can increase a lot the number of native views used and their hierarchy. I mean, while i LOVE the work that UNO is doing, have you tried some of their APP in a mid/low level Android? I have a bunch of cheap devices wich i use to test my apps (Galaxy J10 and Motorola G4 for example). On my J10 the UNO calculator take at least 10 seconds just to start. Then when i switch the calculator type the UI freeze for at least 2 seconds. So while agree on having everything fully customizable i dubt that the current layout system has the power to support this, but i really hope to be wrong! |
Beta Was this translation helpful? Give feedback.
-
I fully support this proposal. We all (I hope!) know that first Windows Phones were running on very poor ARM machines compare to today's mid/low range ones. And the UI was programmed in Silverlight... Full vector UI using XAML. So the idea is not stupid, it will lead to a visual designer like any other XAML, the use of Blend, etc. This is the good road to take for MAUI of course. WPF/E will become a reality, it should be a shame to miss it. |
Beta Was this translation helpful? Give feedback.
-
I completely agree with the customization of controls concept. It is basically just inheriting or overriding a control just like we do with a class. In fact, many controls, including custom controls, do inherit from controls (look at everything that inherits from UserControl). Inheritance & code reusability are some of the, most important concepts in object oriented programming, so applying them to the UI should be just as important as the rest of the code. |
Beta Was this translation helpful? Give feedback.
-
You want the option to fully template all controls like the new RadioButton allows in Xamarin.Forms? https://github.com/davidortinau/LosGatos/blob/main/src/LosGatos/LosGatos/Pages/SettingsPage.xaml#L17 We will continue down this path in .NET MAUI and benchmark performance along the way. This is and has been our main concern with this approach, as @GiampaoloGabba mentions. So it may not suit all needs and cases, but we readily acknowledge it's a powerful option you should have as developers. @odahan the main difference here is that the graphics rendering engine used in Windows Phone was self-contained and could be tightly coupled to the UI control toolkit (XAML the markup is totally unrelated), whereas the rendering you get on Android, iOS, macOS, and Windows are all 4 different (unless you bring along SkiaSharp or the like). The issue is not so much vector here as it is having control over the rendering engine and being able to optimize for it. We have and are looking at SkiaSharp, native graphics (as you see from the Shapes, Paths, and Brushes work recently introduced), and other rendering options. |
Beta Was this translation helpful? Give feedback.
-
The main reason why developers stay with WPF or UWP and don't want to switch to Xamarinh.Forms is because all controls in these frameworks can be completely customized. For example, you can create your AwesomeTextBox and edit it's ControlTemplate, add rounded borders, add gradient backround, add multiple another controls (prime or complex) in one place, and as the result anyway you will have a control that has TextBox`s behavior with extra logic you want.
Unfortunately, we are not able to do so in Xamarin.Forms. It has only 2 controls that giving you such possibility: ContentView and TemplatedView. But with these controls you won`t be able to create custom super-duper TextBox or whatever super-duper you want.
ControlTemplating is very powerfull mechanism and it is sorely lacking in Xamarin.Forms
I suppose you should create something completely new instead of developing Xamarin.Forms with brand new name MAUI.
I think you should create a heap of prime controls and then create a more complex controls from primes such button, textbox, treeview etc. and give user possibility to customize them like he wants as it is in WPF or UWP.
Meaning of crossplatfrom development is to use as less as possible of native development and to increase speed of app development. But in case of Xam.Forms if i want to customize smth, I have to get into native development, but I don't want.
MB, you should look at Flutter and how they managed with customization issue? MB, you shouldn`t use native controls under the hood. It's not too late to reconsider your approach.
BTW, look at UNO Platform, they are trying to make something described above with "code once" principle also and not without success.
Beta Was this translation helpful? Give feedback.
All reactions