如何链接按钮以执行单独操作 [英] How to link a button to do a seperate action

查看:71
本文介绍了如何链接按钮以执行单独操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有这个按钮(或复选框,滑块等)如何根据单击按钮,或选中框或移动滑块来移动另一个项目。那么,当我创建一个按钮时,如果点击该按钮,在该页面上有一个完全独立的项目,我会做些什么。我希望这是有道理的。


解决方案

您可以使用"行为"轻松完成此操作。让我们举一个例子,你想要点击一个按钮改变复选框的IsChecked属性。

[在你的应用程序中]
步骤:
1.创建一个按钮
2.创建一个复选框
3.拖放"ChangePropertyAction"。按钮上的"资产"窗格中的行为
4.选择"ChangePropertyAction"。在"对象和时间线"面板中
5.在"属性"窗格中,选择"checkBox"。作为TargetName
6.选择"IsChecked"属性名称中的属性
7. F5

您将看到单击该按钮时,复选框的IsChecked属性已更改。类似地,您可以在不同控件上的不同事件上设置/重置控件的不同属性。您还可以使用"ControlStoryboardAction"和"ControlStoryboardAction"。 /"GotoStateAction"在控件的不同事件上播放故事板/状态动画。

希望这有帮助。

问候,
Navit Saxena



I have this button (or check box, slider etc)  how do I get another item to move based on when I click the button, or check the box or move the slider.  So how, when I created a button,  do I get the button when clicked to have a totally separate item on that page do something.  I hope that makes sense. 


解决方案

Hi,
      You can easily do this using Behaviors. Lets take an example, you want to change IsChecked property of a checkbox on click of a button.

[In Your Application]
Steps:
           1. Create a Button
           2. Create a Checkbox
           3. Drag and drop "ChangePropertyAction" behavior from Asset pane on the button
           4. Select "ChangePropertyAction" in Object and Timeline panel
           5. In Properties pane select "checkBox" as the TargetName
           6. Select "IsChecked" property in the Property name
           7. F5

You will see that on click of the button the IsChecked property of the checkbox is changed. Similary you can set / reset different properties of control on different events on a different control. You can also use "ControlStoryboardAction" / "GotoStateAction" to play storyboards / state animations on different events of a control.

Hope this helps.

Regards,
Navit Saxena
 


这篇关于如何链接按钮以执行单独操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆