I studied the coding4fun dialog box yesterday and found that it is still too complicated and does not conform to my style. It is simple and low-key. So I took a look at toastprompt, and then made an object-oriented encapsulation.
FirstCodeSegment:
/// // message prompt /// /// message content /// title /// prompt the display expiration time of the message. Unit: millisecond Public void coding4funformsg (string content, String title, int timeout) {solidcolorbrush white = new solidcolorbrush (colors. white); solidcolorbrush Red = new solidcolorbrush (colors. brown); toastprompt toast = new toastprompt {background = red, istimerenabled = true, isappbarvisible = true, millisecondsuntilhidden = timeout, foreground = white,}; toast. title = title; toast. message = content; toast. textorientation = system. windows. controls. orientation. horizontal; toast. show () ;}
Second call:
New classes. util. MSG (). coding4funformsg ("this is content", "title", 3000 );
Last(Compared with yesterday's dialog box, it's much more handsome)
This was yesterday's: Click to open the blog article link of yesterday
This is the implementation of the above Code:
Conclusion: The difference is huge and the effect is obvious. Mobile phone display is small, but humanized prompts and operations will win the user experience!