Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have a question, how does MVUX implement partial pages #2613

Open
5 of 6 tasks
lhLife opened this issue Nov 15, 2024 · 3 comments
Open
5 of 6 tasks

I have a question, how does MVUX implement partial pages #2613

lhLife opened this issue Nov 15, 2024 · 3 comments
Labels
kind/enhancement New feature or request. triage/untriaged Indicates an issue requires triaging or verification.

Comments

@lhLife
Copy link

lhLife commented Nov 15, 2024

What would you like to be added:

Partial page loading issue
Implement the mode of LoadViewModel

CircleApp.zip

Why is this needed:

For which Platform:

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

Anything else we need to know?

@lhLife lhLife added kind/enhancement New feature or request. triage/untriaged Indicates an issue requires triaging or verification. labels Nov 15, 2024
@kazo0
Copy link
Contributor

kazo0 commented Nov 15, 2024

Hi @lhLife! Thanks for the issue!

What were the exact errors your were receiving when building?

The partial plays a role in the necessary code generation for your partial Model/ViewModel. There are explanations for this on the current MVUX docs.

image

@lhLife
Copy link
Author

lhLife commented Nov 16, 2024

`
new Grid()
    .Grid(row: 0)
    .Region(true, navigator: PanelVisiblityNavigator.NavigatorName)
    .Children(
        new HomePage()
            .Visibility(Visibility.Visible)
            .Region(true, name: "home1")
            .LoadViewModel(true, container: page),
        new SecondPage()
            .Visibility(Visibility.Collapsed)
            .Region(true, name: "home2")
            .LoadViewModel(true, container: page)
    ),
new TabBar()
    .Grid(row: 1)
    .Region(true)
    .CornerRadius(0)
    .SelectedIndex(0)
    .Items(
        new TabBarItem()
            .Content("首页")
            .Region(name: "home1")
            .Icon(new FontIcon().FontFamily(a => a.StaticResource("SymbolThemeFontFamily")).Glyph("\uE721")),
        new TabBarItem()
            .Content("广场")
            .Region(name: "home2")
            .Icon(new FontIcon().FontFamily(a => a.StaticResource("SymbolThemeFontFamily")).Glyph("\uE721")),
        new TabBarItem()
            .Content("消息")
            .Region(name: "home3")
            .Icon(new FontIcon().FontFamily(a => a.StaticResource("SymbolThemeFontFamily")).Glyph("\uE721")),
        new TabBarItem()
            .Content("我的")
            .Region(name: "home4")
            .Icon(new FontIcon().FontFamily(a => a.StaticResource("SymbolThemeFontFamily")).Glyph("\uE721"))
    )
`

How to load ViewModel when implementing new Page()

LoadViewModel(true, container: page) in the example code.

TabBar cannot display the first page (region name is home1) through SelectedIndex during initialization

@lhLife
Copy link
Author

lhLife commented Nov 16, 2024

There are the following questions:
1.How to use other pages (or regions) on a page and load ViewModel.
2.How to instantiate a Page and transfer data when the TabView control is dynamically created.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/enhancement New feature or request. triage/untriaged Indicates an issue requires triaging or verification.
Projects
None yet
Development

No branches or pull requests

2 participants