Coding4fun dialog box operation for Windows Phone development

Source: Internet
Author: User

Last year, we compared the Windows Phone pop-up box with coding4fun [http://blog.csdn.net/fengyarongaa/article/details/7077031133 ]. Today, I will post all the operation classes.

1. Download a coding4fun DLL file and reference it to the project, you know!

Http://coding4fun.codeplex.com/

2. directly add the code.

 

[CSHARP]View plaincopyprint?

  1. Using system;
  2. Using system. net;
  3. Using system. windows;
  4. Using system. Windows. controls;
  5. Using system. Windows. documents;
  6. Using system. Windows. Ink;
  7. Using system. Windows. input;
  8. Using system. Windows. Media;
  9. Using system. Windows. Media. animation;
  10. Using system. Windows. shapes;
  11. Using coding4fun. Phone;
  12. Using coding4fun. Phone. controls;
  13. // @ Yr. Feng
  14. Namespace microblogforwp7.classes. util
  15. {
  16. /// <Summary>
  17. /// Dialog box
  18. /// </Summary>
  19. Public class msg
  20. {
  21. /// <Summary>
  22. /// Message prompt box with the "OK" and "cancel" buttons. Return Value: bool type
  23. /// </Summary>
  24. /// <Param name = "content"> message content </param>
  25. /// <Param name = "title"> title </param>
  26. /// <Returns> true or false </returns>
  27. Public bool returnconfirfmsg (string content, String title)
  28. {
  29. Messageboxresult M = MessageBox. Show (content, title, messageboxbutton. okcancel );
  30. If (M = messageboxresult. OK)
  31. {
  32. Return true;
  33. }
  34. Else
  35. {
  36. Return false;
  37. }
  38. }
  39. /// <Summary>
  40. /// Message prompt box with the "OK" button. Return Value: bool type
  41. /// </Summary>
  42. /// <Param name = "content"> message content </param>
  43. /// <Param name = "title"> title </param>
  44. /// <Returns> true or false </returns>
  45. Public bool returnconfirfmsgbyok (string content, String title)
  46. {
  47. Messageboxresult M = MessageBox. Show (content, title, messageboxbutton. OK );
  48. If (M = messageboxresult. OK)
  49. {
  50. Return true;
  51. }
  52. Else
  53. {
  54. Return false;
  55. }
  56. }
  57. /// <Summary>
  58. /// Message prompt box with the "OK" button. No return value
  59. /// </Summary>
  60. /// <Param name = "content"> message content </param>
  61. /// <Param name = "title"> title </param>
  62. Public void confirfmsgforok (string content, String title)
  63. {
  64. MessageBox. Show (content, title, messageboxbutton. OK );
  65. }
  66. /// <Summary>
  67. /// Message prompt box with "OK" and "cancel" buttons. No return value
  68. /// </Summary>
  69. /// <Param name = "content"> message content </param>
  70. /// <Param name = "title"> title </param>
  71. Public void confirfmsgforokcancel (string content, String title)
  72. {
  73. MessageBox. Show (content, title, messageboxbutton. okcancel );
  74. }
  75. /// <Summary>
  76. /// Use the fade-in and fade-out dialog box of the coding4fun component. No return value
  77. /// </Summary>
  78. /// <Param name = "content"> message content </param>
  79. /// <Param name = "title"> title </param>
  80. /// <Param name = "timeout"> displays the message expiration time. Unit: milliseconds </param>
  81. Public void coding4funformsg (string content, String title, int timeout)
  82. {
  83. Solidcolorbrush white = new solidcolorbrush (colors. White );
  84. Solidcolorbrush Red = new solidcolorbrush (colors. Brown );
  85. Toastprompt toast = new toastprompt
  86. {
  87. Background = red,
  88. Istimerenabled = true,
  89. Isappbarvisible = true,
  90. Millisecondsuntilhidden = timeout,
  91. Foreground = white,
  92. };
  93. Toast. Title = title;
  94. Toast. Message = content;
  95. Toast. textorientation = system. Windows. Controls. Orientation. horizontal;
  96. Toast. Show ();
  97. }
  98. }
  99. }
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.