Windows Phone pop-up dialog box component try demo

Source: Internet
Author: User

Not to mention nonsense. I tried to test the components of a dialog box by waiting for my house to get off work. I think it is quite good. I would like to recommend Windows Phone developers.

FirstDownload a third-party component and put it in the bin directory. : Click to open the link

SecondI directly paste code

NextIs the front-end XAML code:

<Phone: phoneapplicationpage X: class = "microblogforwp7.accountmanager" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: x = "http://schemas.microsoft.com/winfx/2006/xaml" xmlns: Phone = "CLR-namespace: Microsoft. phone. controls; Assembly = Microsoft. phone "xmlns: shell =" CLR-namespace: Microsoft. phone. shell; Assembly = Microsoft. phone "xmlns: D =" http://schemas.microsoft.com/expression/blend/200 8 "xmlns: MC = "http://schemas.openxmlformats.org/markup-compatibility/2006" fontfamily = "{staticresource quota}" fontsize = "{staticresource quota}" foreground = "{staticresource quota}" supportedorientations = "portrait" orientation = "portrait" MC: ignorable = "D" D: designheight = "768" D: designwidth = "480" shell: systemtray. isvisible = "true" xmlns: Toolkit = "CLR-namespac E: Microsoft. Phone. controls; Assembly = Microsoft. Phone. Controls. toolkit "> <! -- Layoutroot is the root grid where all page content is placed --> <grid X: Name = "layoutroot"> <grid. background> <imagebrush imagesource = "/resource/image/bs480480.png"> </imagebrush> </grid. background> <grid. rowdefinitions> <rowdefinition Height = "Auto"/> <rowdefinition Height = "*"/> </grid. rowdefinitions> <! -- Titlepanel contains the name of the application and page title --> <stackpanel X: Name = "titlepanel" grid. row = "0" margin = ","> <textblock X: Name = "applicationtitle" text = "test" foreground = "darkred"/> <textblock X: name = "pagetitle" text = "test page" margin = "9,-7,0, 0" foreground = "darkred" fontsize = "55"/> </stackpanel> <! -- Contentpanel-place additional content here --> <grid X: Name = "contentpanel" grid. row = "1" margin = "12, 0, "> <button content =" prompt 1 "foreground =" darkred "Height =" 72 "horizontalalignment =" Left "margin =, 0, 0 "name =" button1 "verticalignment =" TOP "width =" 160 "Click =" button#click "/> <button content =" Tip 2 "foreground =" darkred "Height =" 72 "horizontalalignment =" Left "margin =" 47,123, 0, 0 "name =" button2 "verticalignment =" TOP "width =" 160 "Click =" button2_click "/> <button content =" prompt and enter the password "foreground =" darkred "height = "72" horizontalalignment = "Left" margin = "47,216, 0, 0 "name =" button3 "verticalignment =" TOP "width =" 263 "Click =" button3_click "/> <button content =" prompt and enter the account "Height =" 72 "foreground = "darkred" horizontalalignment = "Left" margin = "47,313, 0, 0 "name =" button4 "verticalignment =" TOP "width =" 263 "Click =" button4_click "/> <button content =" Tip 3 "foreground =" darkred "Height =" 72 "horizontalalignment =" Left "margin =" 76,414, 131 "name =" button5 "verticalignment =" TOP "width =" "Click =" button5_click "/> </GRID> </Phone: phoneapplicationpage>

LastIs the CS background code:

Using system; using system. collections. generic; using system. LINQ; using system. net; using system. windows; using system. windows. controls; using system. windows. documents; using system. windows. input; using system. windows. media; using system. windows. media. animation; using system. windows. shapes; using Microsoft. phone. controls; using system. io. isolatedstorage; using coding4fun. phone; using coding4fun. phone. controls; n Amespace microblogforwp7 {public partial class accountmanager: phoneapplicationpage {public accountmanager () {initializecomponent ();} private void button#click (Object sender, routedeventargs E) {var messageprompt = new messageprompt {Title = "prompt", message = "error message prompt",}; messageprompt. show ();} private void button2_click (Object sender, routedeventargs e) {VaR about = new aboutprompt (); abo Ut. completed + = baseobject_completed; about. show ();} void baseobject_completed (Object sender, popupeventargs <object, popupresult> E) {If (E. popupresult = popupresult. OK) MessageBox. show ("OK! "); Else if (E. popupresult = popupresult. cancelled) MessageBox. Show (" cancelled! "); Else MessageBox. Show (" meh? ");} Private void button3_click (Object sender, routedeventargs e) {var passwordinput = new passwordinputprompt {Title =" input basic ", message = "I'm a basic input prompt",}; passwordinput. completed + = input_completed; passwordinput. show ();} void input_completed (Object sender, popupeventargs <string, popupresult> E) {If (E. popupresult = popupresult. OK) MessageBox. show ("You typed:" + E. result ); Else if (E. popupresult = popupresult. cancelled) MessageBox. Show ("cancelled! "+ E. Result); else MessageBox. Show (" meh? "+ E. result);} private void button4_click (Object sender, routedeventargs e) {var input = new inputprompt {Title = "Basic Input ", message = "I'm a basic input prompt",}; input. completed + = input_completeds; input. show ();} void input_completeds (Object sender, popupeventargs <string, popupresult> E) {If (E. popupresult = popupresult. OK) MessageBox. show ("You typed:" + E. result); else if (E. popu Presult = popupresult. cancelled) MessageBox. Show ("cancelled! "+ E. Result); else MessageBox. Show (" meh? "+ E. result);} private void button5_click (Object sender, routedeventargs e) {var messageprompt = new messageprompt {Title = "basic message", message = "I'm a basic message prompt. ",}; messageprompt. completed + = stringobject_completed; messageprompt. show ();} void stringobject_completed (Object sender, popupeventargs <string, popupresult> E) {If (E. popupresult = popupresult. OK) MessageBox. sho W ("OK:" + E. result); else if (E. popupresult = popupresult. cancelled) MessageBox. show ("cancelled:" + E. result); else MessageBox. show ("meh?: "+ E. Result );}}}

Related Article

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.