时间:2016年07月21日 | 作者 : aaronyang | 分类 : WPF | 浏览: 1425次 | 评论 0 人
====================www.ayjs.net 杨洋 wpfui.com ayui ay aaronyang=======请不要转载谢谢了。=========
DEMO5:
<Button Content="单击阻止冒泡" Margin="50,240,0,0" Width="200" Height="40" VerticalAlignment="Top" HorizontalAlignment="Left"> <p:Attached.Operations> <p:EventHandler Path="Click"> <p:Set Path="@AssociatedObject.FontSize" ValuePath="22"/> <p:Set Path="@EventArgs.Handled" ValuePath="true"/> </p:EventHandler> </p:Attached.Operations> </Button>
通过Set设置属性,通过@符号,表示对象变量
====================www.ayjs.net 杨洋 wpfui.com ayui ay aaronyang=======请不要转载谢谢了。=========
DEMO6
Call调用方法,也可以使用Expr传递参数
<Rectangle Fill="Yellow" Width="200" Height="200" Margin="50,240,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"> <p:Attached.Operations> <p:EventHandler Path="MouseLeftButtonDown"> <p:Call Path="[MessageBox].Show"> <p:Expr Value="Hello, AY Progamming!"/> </p:Call> </p:EventHandler> </p:Attached.Operations> </Rectangle>
DEMO7
使用Argument
<Rectangle Fill="Green" Width="200" Height="200" Margin="250,240,0,0" VerticalAlignment="Top" HorizontalAlignment="Left"> <p:Attached.Operations> <p:EventHandler Path="MouseLeftButtonDown"> <p:Call Path="[MessageBox].Show" Argument="Hello, AY Progamming2!"></p:Call> </p:EventHandler> </p:Attached.Operations> </Rectangle>
效果图:
当然你也可以使用
<p:Attached.Operations> <p:CallHandler Path="MouseLeftButtonDown => [MessageBox].Show" Argument="Hello, world!"/> </p:Attached.Operations>
或者
<p:Attached.Operations> <p:EventHandler Path="MouseLeftButtonDown => [MessageBox].Show('Hello, world!')"/> </p:Attached.Operations>
或者直接
<Rectangle Fill="Pink" Width="200" Height="200" Margin="450,240,0,0" VerticalAlignment="Top" HorizontalAlignment="Left" p:Attached.Operations="MouseLeftButtonDown => [MessageBox].Show('Hello, AY Progamming3!')"> </Rectangle>
====================www.ayjs.net 杨洋 wpfui.com ayui ay aaronyang=======请不要转载谢谢了。=========
.
推荐您阅读更多有关于“WPF4.5,”的文章
抖音:wpfui 工作wpf,目前主maui
招聘合肥一枚WPF工程师,跟我一个开发组,10-15K,欢迎打扰
目前在合肥市企迈科技就职
AYUI8全源码 Github地址:前往获取
杨洋(AaronYang简称AY,安徽六安人)和AY交流
高中学历,2010年开始web开发,2015年1月17日开始学习WPF
声明:AYUI7个人与商用免费,源码可购买。部分DEMO不免费
不是从我处购买的ayui7源码,我不提供任何技术服务,如果你举报从哪里买的,我可以帮你转正为我的客户,并送demo
查看捐赠AYUI7.X MVC教程 更新如下:
第一课 第二课 程序加密教程
额 本文暂时没人评论 来添加一个吧
发表评论