记住Sketchflow应用程序中屏幕之间的复选框状态。 [英] Remembering checkbox states between screens in a Sketchflow app.

查看:98
本文介绍了记住Sketchflow应用程序中屏幕之间的复选框状态。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好
在一个非常简单的层面我有两个屏幕。第一个屏幕有一系列复选框,例如选择你最喜欢的颜色?蓝色,红色,绿色,黄色

第二个屏幕然后包含一些文本框,例如输入你的名字

我在两个屏幕之间往返导航。我想要做的是记住第一个屏幕上的复选框选择和输入复选框的数据。这可能吗?

Hi

At a very simple level I have two screens. The first screen has a series of checkboxes e.g. Choose Your Favourite Colours? Blue, Red, Green, Yellow

The second screen then contains some text boxes e.g. enter your name

I have navigation back and forward between the two screens.  What I want to do is remember the checkbox selections on the first screen and data entered into the checkboxes.  Is this possible?

推荐答案

你好蒂姆,

这是一个很好的问题! :)

幸运的是,使用行为/触发器/动作,您可以根据自己的喜好找到解决方案。我已经创建了一个示例来演示这一点 - 尝试在文本框中输入文本并设置复选框状态:

http://cid-99b45ff02d12b84d.skydrive.live.com/self.aspx/Public/Scratch/DataState.zip

这是示例如何工作:

a)我创建了一个新的Action - SaveDataAction。这个动作的作用是它记住了你可以应用这个动作的各种控件所需的属性的状态(如果你想要一个元素的多个属性,你可以对每个属性应用相同的动作)。 /> b)Action在单例数据结构中记住了属性值(代码的这个区域可能需要很多帮助,因为我只是以最快的方式将它们放在一起)。
)c)使用Action,您只需将其放到Asset库中的元素上(只需搜索SaveDataAction)。确保为元素指定一个Name,并确保将proeprty网格中的属性名称设置为要保存的属性(对于CheckBox情况,将为"IsChecked")。当然,根据您的情况,您可以做一些相当复杂的事情(我们确实希望开箱即用这种类型的行为 - 我们将来会有一些好主意 - 将来)。希望这会有所帮助!

Unni
Hi Tim,

Ah, this is a great question! :)

Fortunately, using Behaviors/Triggers/Actions, you can come up with a solution to your liking. I have created a sample to demonstrate this - try entering text in the textbox and setting the checkbox state:

http://cid-99b45ff02d12b84d.skydrive.live.com/self.aspx/Public/Scratch/DataState.zip

Here is how the sample works:

a) I created a new Action - SaveDataAction. What this action does is that it remember the states of the properties that you want for the various controls that you can apply this action onto (if you wanted multiple properties for an element, you could apply the same action to each property).
b) The Action remember the property values for you in a singleton data structure (this area of the code could require a lot of help, as I just put this together in the fastest way possible).
c) To use the Action, you would just drop it onto an element from the Asset library (just search for SaveDataAction). Make sure to give the element a Name, and make sure to set the property name in the proeprty grid to the property that you want to save off (for the CheckBox case, that would be "IsChecked").

Of course, depending upon your scenarios, you could do some pretty sophisticated things (and we do want to enable this type of behavior out of the box - we have some great ideas here - in the future). Hope this helps!

Unni


这篇关于记住Sketchflow应用程序中屏幕之间的复选框状态。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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