WP中弹出层学习
来源:互联网 发布:www.js study.cn 编辑:程序博客网 时间:2024/05/16 09:03
最近在项目中有个功能是,当点击一个内容是电话号码的单元格时,弹出一个打电话的图像,当点击图像时调用系统的打电话的功能,弹出那个打电话的图像的实现思路是:新建一个Canvas,在这个画布中添加一个Popup控件,在这个Popup控件中加入一个Image控件,这个控件的图片路径是那个电话图片的路径
Image messagePhone = new Image();
messagePhone.Source = new BitmapImage(new Uri("ImageResources/report.messagesend.png", UriKind.Relative));这里要注意Source属性的类型,
接下来把Popup的child属性设置成Image对象,在把Popup对象加入到Canvas中,在画布中添加一个事件,鼠标点击事件,在这个事件中我们要把Popup的Isopen属性设置为false,如果我们使用的代码New的Popup控件,注意这里要把它弄到类里面,如果是托的,就不用管了。
这是我写的部分代码
Button btnPhone = new Button();
Image imagePhone = new Image();
//imagePhone.Stretch = Stretch.Fill;
imagePhone.Source=new BitmapImage(new Uri("ImageResources/report.phonecall.png",UriKind.Relative));
btnPhone.Content = imagePhone;
btnPhone.Click += btnPhone_Click;
Button btnMessage = new Button();
Image messagePhone = new Image();
messagePhone.Source = new BitmapImage(new Uri("ImageResources/report.messagesend.png", UriKind.Relative));
// messagePhone.Stretch = Stretch.Fill;
btnMessage.Content = messagePhone;
btnMessage.Click += btnMessage_Click;
StackPanel sp = new StackPanel();
sp.Background = new SolidColorBrush(Colors.Blue);
sp.Children.Add(btnPhone);
sp.Children.Add(btnMessage);
pop = new Popup();
pop.Child = sp;
pop.IsOpen = true;
Canvas ca = new Canvas();
ca.Children.Add(pop);
ca.Background = new SolidColorBrush(Colors.Transparent);
this.LayoutRoot.Children.Add(ca);
- WP中弹出层学习
- 网页制作中弹出层的方法
- bootstrap中弹出层model的用法
- JQuery中弹出层位置设置
- asp.net中弹出层效果(div,不可拖拉)
- layer插件如何在弹出层中弹出一警告提示并关闭弹出层
- 网页中弹出窗口
- 从框架中弹出
- Swing中弹出对话框
- c#中弹出对话框
- MFC中弹出对话框
- java中弹出对话框
- Dialog中弹出PopupWindow
- Swing中弹出对话框
- servlet中弹出对话框
- IE中弹出地址
- Application中弹出Dialog
- UIWebView中弹出UIPopoverController
- 征服 Ajax 应用程序的安全威胁
- 继承映射(多表)
- linux下SVN常用指令
- linux及windows下weblogic自启动设置。
- 【转】新手如何使用阿里云(linux)服务器建站(搬站)
- WP中弹出层学习
- mysql 中文字段排序( 按拼音首字母排序) 的查询语句
- 如何提高你的工作效率
- gcc版本切换
- 顺时针/螺旋打印数组
- 究竟我们为什么要学C语言呢
- ServletContextListener简单使用
- 解析 Linux 中的 VFS 文件系统机制
- JSP页面代码的载入顺序和执行