Skip to content

[MVUX] Update Bindable Generator Attribute Naming #2515

Closed

Description

@ajpinedam

What would you like to be added:

Rename the Bindable Generator Attribute to something more generic, especially now that this is not generating BindableModels anymore but instead it is generating ViewModels

Why is this needed:

For which Platform:

  • iOS
  • Android
  • WebAssembly
  • WebAssembly renders for Xamarin.Forms
  • Windows
  • Build tasks

Anything else we need to know?

Activity

  1. added
    kind/enhancement
    triage/untriaged
    on Aug 20, 2024
  2. self-assigned this
    on Aug 20, 2024
  3. dr1rrb commented on Aug 20, 2024

    @dr1rrb
    Member

    Considering that the BindableAttribute is the attribute used by windows to flag object that should be accessible to the binding engine, I would not introduce a breaking change to rename those attributes.

  4. francoistanguay commented on Aug 21, 2024

    @francoistanguay
    Contributor

    Didnt realize BindableGenerator was "associated" to the BindableAttribute idea. Happy to keep it as-is for now.

  5. DevTKSS commented on Dec 12, 2024

    @DevTKSS
    Contributor

    My compiler is also telling that on each viewModel the Bindable attribute is missing although the mainmodel and MainPage having it added by me

  6. ajpinedam commented on Dec 12, 2024

    @ajpinedam
    ContributorAuthor

    Hi @DevTKSS, I'm sorry, but I don't quite understand your previous comment. What error are you receiving?

    Please also provide more information about the Uno version you are using and, if possible, attach some ways to reproduce the error. I would appreciate it.

  7. DevTKSS commented on Dec 12, 2024

    @DevTKSS
    Contributor

    @ajpinedam
    The Bindable attribute is missing and the type [UnoHotDesignApp1.Presentation.MainViewModel] is not known by the MetadataProvider. Reflection was used instead of the binding engine and generated static metadata. Add the Bindable attribute to prevent this message and performance issues.

    that is happening on mvux, where I essentially can not even add the BindableAttribuge it is telling me to do. if we would be able to get the generator add this attribute, that maybe could solve this....

  8. Mike-E-angelo commented on Dec 18, 2024

    @Mike-E-angelo

    I am seeing the same messages that @DevTKSS is seeing as well:

    The Bindable attribute is missing and the type [<Root>.Application.Presentation.MainPage] is not known by the MetadataProvider. Reflection was used instead of the binding engine and generated static metadata. Add the Bindable attribute to prevent this message and performance issues.
    The Bindable attribute is missing and the type [<Root>.Application.Presentation.MainViewModel] is not known by the MetadataProvider. Reflection was used instead of the binding engine and generated static metadata. Add the Bindable attribute to prevent this message and performance issues.
    
  9. dr1rrb commented on Dec 18, 2024

    @dr1rrb
    Member

    @DevTKSS @Mike-E-angelo We are already adding a [BindableAttribute] on VM generated by MVUX which then should be considered by the bindable type provider generator. So it seems to indicate that we have another bigger issue. On which platform do you get those error messages?

    Also @Mike-E-angelo it's surprising that you also get this message for the MainPage. If it inherits from a DepndencyObject the attribute should be set transitively (as it's been set on DependencyObject by uno). What is the base type of your MainPage?

  10. Mike-E-angelo commented on Dec 18, 2024

    @Mike-E-angelo

    Hi @dr1rrb I am seeing this on net9.0-desktop (the only platform I am trying right now). Additionally MainPage is a basic Microsoft.UI.Xaml.Controls.Page, Uno.UI page. 🤔

  11. DevTKSS commented on Dec 18, 2024

    @DevTKSS
    Contributor

    @dr1rrb would have to check if its .net 8 or 9 but i am absolutely sure my current one is desktop only target because I am doing studio stuff where i had the issue before with a additional Windows target its really slow and way more buggy.
    But the Bindableattribute related issue is happening at build even before i could even try to enter Studio.
    I did get the issue Before (about sdk version 43 or so?) @Mike-E-angelo did tell about with the Mainpage also not having this attribute. It told it to be mainModel, mainPage and in that case not mentioning the viewModel 😅 when i added this attribute above the class it has been fine, only issue has been then also, the x:Bind to not working with mvux what I would have seen as the big advantage ob mvux to mvvm, and this would be (to me) a good reason to maybe also learn mvvm in the future.
    In the application where this stopped i think i had been using desktop, android, ios, windows... You could look into my GitHub repos like the "MyUnoXamlApp" or similar named. Each of them is having issues why i did not continue to work on them. Not got mvux in my head then, starting with navigation which I currently carefully maybe have running in my current application.
    But the downside, the last studio using application I committed and pushed to GitHub is after cloning to my local device not longer nicly running. Its hell to work with it. Laggy +1000%, login issue und studio not longer showing up (it did before!)
    So for that reason I am currently porting the app comtent to the new one which is only targeting desktop and running smoothly. Okay with minor laggyness but way less than at the best time of the +windows one!

  12. Mike-E-angelo commented on Dec 19, 2024

    @Mike-E-angelo

    So I am noticing one of the warnings go away when I update my code-behind from this:

    public sealed partial class MainPage // <-- Warning
    {
    	public MainPage()
    	{
    		InitializeComponent();
    	}
    }
    

    To this:

    public sealed partial class MainPage : Page // <-- No Warning
    {
    	public MainPage()
    	{
    		InitializeComponent();
    	}
    }
    
  13. dr1rrb commented on Dec 19, 2024

    @dr1rrb
    Member

    Ok so if both of you are getting this issue on desktop target, it means it's definitely linked to one of our generators (MVUX or Uno)

    But this is interesting :

    So I am noticing one of the warnings go away when I update my code-behind from this: [../..]

    cc. @jeromelaban

    It means that it's probably only that MVUX's [Bindable] is not considered by the generator ... or it's generated too late! Opened a new issue for that #2648 (as it's not linked to the original issue).

  14. Youssef1313 commented on Jan 7, 2025

    @Youssef1313
    Member

    @dr1rrb This behavior is expected. #2648 (comment)

  15. DevTKSS commented on May 19, 2025

    @DevTKSS
    Contributor

    @Youssef1313 is this issue still current?

  16. dr1rrb commented on May 20, 2025

    @dr1rrb
    Member

    No, closing it. We still have #2648 to look at, but this is not linked to the original report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/enhancementtriage/untriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions