Windows Phone开发之Coding4Fun对话框操作类
2012-05-07 17:50
381 查看
去年把windows phone手机的自带弹出框和Coding4Fun做了一个对比【/article/1359314.html】。今天就把操作类全部贴出来。
1.自己先下载一个Coding4Fun的dll文件,然后引用到项目里面,你懂的!
下载地址http://coding4fun.codeplex.com/
2.直接上代码。
1.自己先下载一个Coding4Fun的dll文件,然后引用到项目里面,你懂的!
下载地址http://coding4fun.codeplex.com/
2.直接上代码。
using System; using System.Net; using System.Windows; using System.Windows.Controls; using System.Windows.Documents; using System.Windows.Ink; using System.Windows.Input; using System.Windows.Media; using System.Windows.Media.Animation; using System.Windows.Shapes; using Coding4Fun.Phone; using Coding4Fun.Phone.Controls; //@yr.feng namespace MicroBlogForWP7.Classes.Util { /// <summary> /// 对话框 /// </summary> public class Msg { /// <summary> /// 带有"确定"和"取消"按钮消息提示框。返回值为bool类型 /// </summary> /// <param name="content">提示的信息内容</param> /// <param name="title">提示的标题</param> /// <returns>ture or false</returns> public bool ReturnConfirfMsg(string content, string title) { MessageBoxResult m = MessageBox.Show(content, title, MessageBoxButton.OKCancel); if (m == MessageBoxResult.OK) { return true; } else { return false; } } /// <summary> /// 带有"确定"按钮消息提示框。返回值为bool类型 /// </summary> /// <param name="content">提示的信息内容</param> /// <param name="title">提示的标题</param> /// <returns>ture or false</returns> public bool ReturnConfirfMsgByOk(string content, string title) { MessageBoxResult m = MessageBox.Show(content, title, MessageBoxButton.OK); if (m == MessageBoxResult.OK) { return true; } else { return false; } } /// <summary> /// 带"确定"按钮的消息提示框。不具有返回值 /// </summary> /// <param name="content">提示的信息内容</param> /// <param name="title">提示的标题</param> public void ConfirfMsgForOK(string content, string title) { MessageBox.Show(content, title, MessageBoxButton.OK); } /// <summary> /// 带"确定"和"取消"按钮的消息提示框。不具有返回值 /// </summary> /// <param name="content">提示的信息内容</param> /// <param name="title">提示的标题</param> public void ConfirfMsgForOKCancel(string content, string title) { MessageBox.Show(content, title, MessageBoxButton.OKCancel); } /// <summary> /// 使用Coding4Fun组件的淡入淡出对话框。不具有返回值 /// </summary> /// <param name="content">提示的信息内容</param> /// <param name="title">提示的标题</param> /// <param name="timeout">提示消息的显示过期时间。单位毫秒</param> 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(); } } }
相关文章推荐
- Windows Phone开发之Coding4Fun对话框操作类
- Windows Phone 8初学者开发—第17部分:Coding4Fun工具包简介
- windows phone开发之ToastPrompt测试Demo与Coding4Fun效果对比(有图有真相)
- Windows Phone开发之ToastPrompt测试Demo与Coding4Fun效果对比(有图有真相)
- Windows Phone 8初学者开发—第17部分:Coding4Fun工具包简介
- Coding4Fun:开始游戏开发
- Windows Phone开发之发送邮件操作类
- Windows Phone 7 Coding4Fun的弹出框--来源:http://www.cnblogs.com/majian714/archive/2011/12/02/2272060.html
- Windows Phone 7 Coding4Fun的弹出框
- Windows Phone 7 Coding4Fun的弹出框
- Windows Phone 7 Coding4Fun的弹出框
- Windows phone开发IsolatedStorageSettings 操作类
- Windows Phone 7 Coding4Fun控件简介
- WP7开发中Coding4Fun的五种弹出框介绍
- Windows Phone 8初学者开发—第23部分:测试并向应用商店提交
- Windows Phone 7学习资料包囊(开发工具/教程/论坛/博客)
- wp7、8丿____如何面向多个版本开发 Windows Phone 应用
- Windows Phone 7开发环境的一点问题
- 开发落网电台windows phone 8应用的计划(3)
- 【266期门诊集锦】开启Windows Phone应用开发之旅 推荐