Windows.UI.Popups.MessageDialog does not work for

2019-08-05 01:58发布

问题:

            await new Windows.UI.Popups.MessageDialog("Test").ShowAsync();

Has anyone else noticed this? Is there an easy work around ?

回答1:

I have the some problem and I did't found any trick. I made myself a MessageDialog with a and It's not so hard to build it. Try do take a look this http://bitaware.altervista.org/messagedialog-for-iot/ The unique problem is that it do not work across platforms. If you would this behavior you have to get a condition

string platform = AnalyticsInfo.VersionInfo.DeviceFamily;
if (platform == "Windows.IoT")
{ 
    //Your code for IoT
}
else
{
    //Your code for other devices
}

I know is not elegant but I think we have no other choice. I hope it was helpful