Xamarin.forms 如何发送

Xamarin.forms 如何发送,xamarin.forms,Xamarin.forms,我有一个关于Viem模型的演讲,我正在VM上祝酒,但我得到了一个例外 TabMenuMyArticlesava.Lang.RuntimeException: Can't toast on a thread that has not called Looper.prepare() 我不想显示警报,否则如何从MVVM向用户显示警报?我找到了这个 但我真的不知道如果它不是只与Xamarin.Android连接的话,该怎么办 new System.Threading.Thread(new Threa

我有一个关于Viem模型的演讲,我正在VM上祝酒,但我得到了一个例外

TabMenuMyArticlesava.Lang.RuntimeException: Can't toast on a thread that has not called Looper.prepare()
我不想显示警报,否则如何从MVVM向用户显示警报?我找到了这个 但我真的不知道如果它不是只与Xamarin.Android连接的话,该怎么办

 new System.Threading.Thread(new ThreadStart(() =>
                    {

                        RunOnUiThread(() => { Toast.MakeText(ApplicationContext, "xxxxxx", ToastLength.Short).Show(); });
                    })).Start();
使用

考虑使用IOC容器并注入iSudidiAudio在视图模型的任何地方使用。
MainThread.BeginInvokeOnMainThread(() =>
{
    Toast.MakeText(ApplicationContext, "xxxxxx", ToastLength.Short).Show();
});