-
Notifications
You must be signed in to change notification settings - Fork 4
[Xamarin.Forms] Add wrappers for all controls #53
Comments
The controls with |
I think would be good to Wrap TemplatedView. So we can have something like https://github.com/jsuarezruiz/TemplateUI . What do you think ? |
How do you plan to organise the effort of wrapping this controls ? . We could create the gallery app and then start adding one control per PR + add to the gallery + some screenshot 😀 |
I was investigating the possibility to add support for VisualStateManager (https://docs.microsoft.com/en-us/xamarin/xamarin-forms/user-interface/visual-state-manager as a way to control control states and avoid having to create custom renderers. We already use VisualStateManager in v1 See here https://github.com/fsprojects/Fabulous/blob/8bbb610a2bbfe239e175b8e25ac950d55ebc94f5/Fabulous.XamarinForms/samples/AllControls/AllControls/Samples/Controls/RadioButton.fs#L60 . SoI was wondering if could add some sort of support for it as a extension method 😀 Unlike #10 I think this is not blocked with the V2 architecture . But I might be wrong |
I'm happy to help adding any widgets necessary 😀 |
That would be interesting. Maybe we can keep it for the end so we can better think how to do it?
Right now, I'm working on making AttributeDefinitions pure so unused attributes will be removed from the compiled code (smaller IPA/APK). It might have a big impact on how widgets are declared. But ideally, we should do like you said:
The important part is to make sure we don't forget any properties.
That would be very interesting too, I don't see any blocker with v2. Not exactly sure how to handle target names though. |
Sure 😀. |
@TimLariviere I have started to implement the Carrousel based on the new virtualized collections . But I notice that on my app I will need to support cell types based on the data. As far I can see CarrouselView only has ItemTemplate and EmptyViewTemplate. . So Was wondering if have any thought on the implementation . ? Edit: I realised that I can achieve the result that I want by organising the data using a DU to model the types of data while still uses the same item template 😄 |
@edgarfgp Internally, Fabulous will change the cell type based on the root control passed in the ItemTemplate like you found. :) CarouselView(items) (fun item ->
if item.Name = "Hello" then
Label("Hello World")
else
Button("Click me", Clicked)
) Here, it will instantiate a Label cell when |
@TimLariviere Should we include Behaviour, Triggers and Effects to the list ? |
Triggers are closely related to Style, so I think we need to properly think of VisualStateManagers and Styles before. For Effect, I remember creating a basic one in v1
Maybe we can add the same one to v2? |
Though Effect is not a BindableObject, so no ViewNode no diffing :/ |
@TimLariviere BoxView can be marked as Done . It was completed as part of #73 |
Grid and StackLayout do not need any update . They are already complete Grid : https://docs.microsoft.com/en-us/dotnet/api/xamarin.forms.grid?view=xamarin-forms |
Almost 50% done 🥳 |
Same applies for ProgressBar 😀 |
@TimLariviere RelativeLayout can set the children position based on the on other views . Could we use ViewRef for this ? public static Constraint RelativeToView(View view, Func<RelativeLayout, View, double> measure)
{
var result = new Constraint { _measureFunc = layout => measure(layout, view), RelativeTo = new[] { view } };
return result;
} I had a look at V1 and it does not seem to support for this RelativeToView either . I could only see RelativeToParent |
@TimLariviere Seems like CarrouselPage has been deprecated in favour of CarrouselView . Not sure if it worth to make a wrapper for this ? . From Docs : Important |
Oh alright. If it's deprecated then no need to write a wrapper for it |
@TimLariviere Regarding OpenGLView > I think most people mow a days uses SkiaSharp . So We could avoid wrapping it and also remove the dependency of OpenTK.Graphics on V2 and implement this in case we have request to do it in the future . |
Looks like Maui is not biding it also. https://github.com/dotnet/maui/wiki/Status. I guess the With Shape, Geometries it is ok for now |
Yes. I read a few years ago that iOS even dropped support for OpenGL in favor of Metal. |
Awesome work @edgarfgp! Will start to bring everything we did into the main repo |
Would be great to have a control gallery apps to both test out the wrappers and have a sample on how to use them.
Pages:
TemplatedPage(?)Layouts:
ContentPresenter(?)TemplatedView(?)Controls:
Collections:
TableView(removed because deprecated in MAUI)Cells:
MenuItems:
GestureRecognizers:
The text was updated successfully, but these errors were encountered: