locked
Strange height of MessageDialog

    Question

  • Dear,
    In my Win8 APP have this code:

    MessageDialog dialog = new MessageDialog("my text", "my text");
    dialog.ShowAsync();

    The message is correctly displayed in the center of screen with width 100% and height around 200px.

    Sometimes, the same message (with same code) is displayed full screen with width 100% and 100% height, why ?!?

    This strange behavior leads to both the emulator and on the device.

    Do you have suggestions ?

    Thanks,
    Rinaldo

    • Moved by Mike Danes Wednesday, April 02, 2014 8:11 AM winstore specific
    Wednesday, April 02, 2014 8:04 AM

Answers

  • Hi,

    That's an issue in CoreWindowDialog. I suspect because of the CoreWindowDialog is the dialog of an app window. So its size will change. I think you can use MessageDialog instead of it. Some codes below you can refer to:

     MessageDialog dialog = new MessageDialog(string.Empty, "Questions ?");
                dialog.Commands.Add(new UICommand { Label = "Yes",Id=0 });
                dialog.Commands.Add(new UICommand { Label = "No", Id = 0 });
                dialog.Commands.Add(new UICommand { Label = "Cancel", Id = 0 });
                dialog.ShowAsync();

    And you can see the link below to get more information:

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.popups.messagedialog

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, April 03, 2014 2:13 AM

All replies

  • SOMETIMES CORRECT:

    SOMETIMES INCORRECT:


    Wednesday, April 02, 2014 9:57 AM
  • Hi Rinaldo,

    Can you please share your sample?

    Regards,

    Riyaj Ahamed I

    Wednesday, April 02, 2014 10:41 AM
  • You can see the images on previus post and the code on first post.

    Thanks,

    Rinaldo

    Wednesday, April 02, 2014 10:56 AM
  • I think what Riyaj means is can you post a quick sample project online that demonstrates the issue so we can test it.


    Darin R.

    Wednesday, April 02, 2014 8:20 PM
  • Ah ok,

    If you want test you can download a simple project to this link:

    http://www.lisario.it/App5.zip

    Thanks,

    Rinaldo

    Wednesday, April 02, 2014 8:50 PM
  • Hi,

    That's an issue in CoreWindowDialog. I suspect because of the CoreWindowDialog is the dialog of an app window. So its size will change. I think you can use MessageDialog instead of it. Some codes below you can refer to:

     MessageDialog dialog = new MessageDialog(string.Empty, "Questions ?");
                dialog.Commands.Add(new UICommand { Label = "Yes",Id=0 });
                dialog.Commands.Add(new UICommand { Label = "No", Id = 0 });
                dialog.Commands.Add(new UICommand { Label = "Cancel", Id = 0 });
                dialog.ShowAsync();

    And you can see the link below to get more information:

    http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.popups.messagedialog

    Best Wishes!


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey. Thanks<br/> MSDN Community Support<br/> <br/> Please remember to &quot;Mark as Answer&quot; the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Thursday, April 03, 2014 2:13 AM
  • Dear Anne,

    I've tested your sugegstion now, and it's correct !!!

    I must used MessageDialog instead CoreWindowDialog.

    Thank a lot,

    Rinaldo

    Friday, April 04, 2014 8:24 AM