MessageBox usage in wp7 applications

Source: Internet
Author: User

Ah, I have no time to study at work. I 'd like to talk about some tips.

A problem was encountered during the recent review, which was solved for a long time. It turned out to be a small problem: MessageBox

 

The original code is as follows. When no IP address is entered, the system prompts the user and jumps to the configuration page.

The code is as follows: Copy code

MessageBox. Show ("set the receiver IP address before use ");
GoToConfig (); // jump to the configuration page


If you write such code in WPF, there is no major problem, but the problem occurs in WP7.

When the MessageBox modal window is opened, pressing the "Start Menu" Win key will lead to unexpected situations.

The MessageBox module window is closed and MessageBoxResult. None is returned.

Then continue to execute GoToConfig (); but now the interface and switch to the Start screen,

Directly throw the "This operation is not supported on a relative URI." exception.


Solution:

The code is as follows: Copy code

Var result = MessageBox. Show ("set the receiver IP address before use ");
If (result = MessageBoxResult. OK)
GoToConfig (); // jump to the configuration page


This story tells me how to use MessageBox in WP7. Pay attention to the returned information of MessageBox caused by the Deactivated event.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.