Question

Has anyone heard of any issues with MessageDialog's not displaying on Windows 8 tablets? Or more specifically Samsung 700t? It uses a regular intel process and not ARM. I built the app on a laptop and the messagedialog shows when debugging from the laptop, shows on the tablet simulator but doesn't show on the actual tablet.

I'm using the Caliburn.Micro IResult interface to display the messagedialog in the view.

Heres snippits of code that I'm using:

public IEnumerable<IResult> NavExecute(String method)
{
    Windows.UI.ViewManagement.ApplicationView.TryUnsnap();
    var conn = NetworkInformation.GetInternetConnectionProfile();
    if (conn.GetNetworkConnectivityLevel() != NetworkConnectivityLevel.InternetAccess)
    {
        yield return new MessageDialogResult("Internet Connection Not Detected", "Connection Error");
        netOn = false;

    }

} the above is in my view model base class, and heres the implementation of the IResult class itself:

public class MessageDialogResult : ResultBase
{
    private readonly string _content;
    private readonly string _title;

    public MessageDialogResult(string content, string title)
    {
        _content = content;
        _title = title;
    }

    public async override void Execute(ActionExecutionContext context)
    {
        var dialog = new MessageDialog(_content, _title);

        await dialog.ShowAsync();

        OnCompleted();
    }
}

I doub't it's an issue with the code since I'm debugging in x86 mode on both devices (before anyone asks why I'm not debugging for all devices it's because I'm using SQLite which requires a seperate package for each arhitecture.)

I'm not sure if theres a setting somewhere in Windows 8 that disables in app popups, but I couldn't find one.

Any ideas?

Was it helpful?

Solution

Are you handling the callback of Coroutine.Execute?

The callback on Execute might be calling back with an exception thrown by the coroutine - this would silently fail if you weren't explicitly looking for it in the callback

Coroutine.Execute(YourEnumerator(), new ActionExecutionContext { Blah }, (o, e) => {
    if(e.Error != null) // Something went wrong
});

Maybe the async await is throwing or something like that (can't think why!)

Edit:

Ah additionally stuff in your enumerator could also throw:

Windows.UI.ViewManagement.ApplicationView.TryUnsnap();
var conn = NetworkInformation.GetInternetConnectionProfile();

Either one could throw making the outer enumerator swallow an exception if not handled in the callback - or could be a nullref on conn?

OTHER TIPS

The reason why GetInternetConnectionProfile() was returning a null ref was due to the fact that when on a laptop, if you disconnect from a wireless connection the laptop's internet connection profile defaults to ethernet, whereas the tablet (at least the Samsung 700T) doesn't have an ethernet port so it's connection profile doesn't exist if a wireless connection isn't established.

Thanks to Charleh for pointing me in the right direction.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top