[Original] use of idialogservice instead of dialogmessage in mvvmlight

Source: Internet
Author: User

In the new version of mvvmlight, dialogmessage is marked as obsolete and must be replaced by idialogservice. The specific usage of idialogservice is as follows:

First, implement idialogservice in the main form:

Public partial class mainwindow: window, idialogservice

Public System. Threading. Tasks. Task showerror (Exception error, String title, string buttontext, Action afterhidecallback) {Throw new notimplementedexception ();}

Public System. threading. tasks. task showerror (string message, String title, string buttontext, Action afterhidecallback) {Throw new notimplementedexception ();} public system. threading. tasks. task <bool> showmessage (string message, String title, string buttonconfirmtext, string buttoncanceltext, Action <bool> afterhidecallback) {Throw new notimplementedexception ();} public system. threading. tasks. task showmessage (string message, String title, string buttontext, Action afterhidecallback) {Throw new notimplementedexception ();} public system. threading. tasks. task showmessage (string message, String title) {// throw new notimplementedexception (); MessageBox. show (message, title); return NULL;} public system. threading. tasks. task showmessagebox (string message, String title) {// throw new notimplementedexception (); MessageBox. show (message, title); return NULL ;}
Then register idialogservice: Public idialogservice dialogservice {get {return servicelocator. current. getinstance <idialogservice> () ;}} is called dialogservice. showmessagebox ("enter a name! "," Prompt ");

[Original] use of idialogservice instead of dialogmessage in mvvmlight

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.