Windows Phone开发之Coding4Fun对话框操作类
来源:互联网 发布:淘宝评价语 编辑:程序博客网 时间:2024/05/16 20:29
去年把windows phone手机的自带弹出框和Coding4Fun做了一个对比【http://blog.csdn.net/fengyarongaa/article/details/7077031】。今天就把操作类全部贴出来。
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.fengnamespace 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开发之ToastPrompt测试Demo与Coding4Fun效果对比(有图有真相)
- Windows Phone开发之发送邮件操作类
- Windows phone开发IsolatedStorageSettings 操作类
- Working With Coding4Fun Toolkit MetroFlow Control in Windows Phone 7
- [windows phone开发]文件操作
- Windows Phone开发之DateTime
- Windows Phone之弹出对话框组件尝试Demo
- Windows Phone开发之 Map控件
- Windows Phone开发之 ListBox控件
- Windows Phone开发之动画效果
- Windows Phone开发之 WebClient 讲解
- Windows Phone 开发之 设备方向
- Windows Phone开发之 禁用back键
- Windows Phone开发之获取摄像头
- Windows Phone开发之Image控件
- Windows Phone开发之图片上传
- Windows Phone开发之Accelerometer-加速度传感器
- Maven单元测试
- PB 程序中动态变更窗口菜单
- Sicily 3391 Minimal Sum (难得水题)
- 对于Android的http请求的异常管理
- PB 动态改变菜单背景颜色
- Windows Phone开发之Coding4Fun对话框操作类
- JVM分代和垃圾回收
- 文件系统之百度解释
- linux pgrep命令
- 高级性能测试工程师进阶系列课程
- 关于Hadoop支持部署LZO(后续)
- iframe编辑器光标位置插入内容方法,兼容IE和Firefox
- 根据数据库批量生成实体类
- Spring 3 Hibernate 3.0 annotation proxool连接池配置