通过 .NET MAUI 中的 OnResume 事件刷新列表

问题描述 投票:0回答:0

关于 ScrollViewer 和 RefreshView 中已知的 .NET MAUI 错误,在 here 中讨论,我正在尝试找到解决方法。

所以我删除了 RefreshView,现在只使用 CollectionView。现在唯一缺少的功能是我的列表的“刷新功能”,我现在想用 App.xaml.cs 中的 OnResume 事件触发它,现在看起来像这样:

public partial class App : Application
{
     public App()
    {
        InitializeComponent();
        DependencyService.Register<Services.MockDataStore>();
        MainPage = new AppShell();      
    }

    protected override void OnResume()
    {
        base.OnResume();
        // method call should be implemented here
    }
}

有人知道如何从那行代码访问我的视图模型中的方法吗? 非常感谢。

ios .net mvvm refresh maui
© www.soinside.com 2019 - 2024. All rights reserved.