一个组件中的操作是否可以触发另一个组件中的状态更改? [英] Can an Action in One Component Trigger a State Change in Another Component?

查看:80
本文介绍了一个组件中的操作是否可以触发另一个组件中的状态更改?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我说在同一页面上有两个组件。如果我单击一个组件上的按钮,它是否可以触发页面上其他组件的状态更改?如果是这样,我该怎么做?

Basically, say I have two components on the same page. If I click a button on one component, can it trigger a state change in the other component on the page? If so, how do I go about doing this?

推荐答案

是的,你可以。使用Blend SDK中提供的行为/触发器,您应该能够完成此方案而不需要任何编码。为了帮助您开始打开资产库并导航到"行为"类别。从那里你会发现许多预定义的行为,如GoToStateAction和ChangePropertyAction。将其中一个行为拖出到元素后,您可以设置触发器,使行为"触发"。还包括一些预定义的触发器,但您最感兴趣的是EventTrigger。使用此触发器,您可以指定另一个控件,如按钮,并在单击时查看。
Yes you can.  Using the Behaviors/Triggers that ship in the Blend SDK you should be able to accomplish this scenario with out any coding at all.  To get you started open up your Asset library and navigate to the Behaviors category.  From there you will find many pre-defined behaviors such as GoToStateAction and ChangePropertyAction.  Once you drag one of these behaviors out onto your element you can then set the trigger that will make the behavior 'fire'.  There are some pre-defined triggers included as well but the one you would be most interested in is the EventTrigger.  With this trigger you can specify another control like a button and watch for when it is clicked.


这篇关于一个组件中的操作是否可以触发另一个组件中的状态更改?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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