sketch flow——如何在不破坏 sketchflow 映射的情况下重命名 .xaml 和 .cs 文件?
我们如何重命名 .xaml 和 .cs 文件?
希望能够使开发与原始草图流程保持同步。即 sketchflow 具有诸如能够在每个屏幕的基础上收集客户反馈的能力等功能。...
我在这里回答了我自己的问题,所以我将其作为后续内容发布。 9 小时前在 MS 网站上提出了最初的问题,但没有得到回应...仍在尝试找出与社区交谈的最佳地点,对于重复的问题深表歉意。
答案(有更好的吗?)
背景:Sketchflow 是一种原型设计工具。在大型团队中,您可能希望将原型与最终版本分开,或者有一个大型原型设计阶段。
我的观点是我真的很喜欢 Sketchflow。这是我一段时间以来见过的最酷的东西之一(微软做得很好)。
...所以对我来说,我希望原型成为成品。我希望设计师随时介入并进行过渡。我希望设计师能够启动这个流程,而开发人员则能够提供细节。我希望我们的客户能够在构建过程中随时发布反馈。顺便说一句:让你的开发人员检查一下 MVVM。非常酷。
我敢打赌,如果您进行重大更改(文件重命名),反馈可能会丢失 - 所以请注意这一点。这对我们来说不会是问题。我们将让我们的文件名有意义,然后基本上不去管它。当然,微软可以通过为创建的每个屏幕创建一个全局唯一的 ID(Guid)来解决这个问题。也许他们已经这样做了。如果 MS 的某人读到此内容,请将其放入您请求的功能列表中。
答案:
所以这是对我有用的答案:
不要尝试手动编辑 xaml / cs,因为如果你不小心的话,你可能对行为进行的所有交叉引用都会被破坏。需要修改的典型文件:.csproj、Sketch.Flow、xxxx.xaml 和 xxxx.cs。
要自动执行此操作,请下载 Ultraedit 等工具。或者,您也许可以只使用 VS 2010(未经测试)。
使用 ultraedit 的步骤:(
首先备份您的项目)
在文件中搜索/替换...
在文件中查找...“Screen_1_19”
替换为...“欢迎”
在文件/类型中...“。 "
目录...
仅匹配整个单词
点击“开始”
按照提示操作
将文件(.xaml 和 .cs)重命名为“Welcome”。? ?? (其中 ???? 是 .xaml 或 .cs)。由于我使用 SVN,这一步就为我一步完成了(没什么大不了的)。
- 如果使用 VS2010 执行步骤 1 到 8,请小心先进行较长的字符串替换,例如 Screen_1_19 在 Screen_1 之前。我认为 VS 将 _ 视为断词。在 ultraedit 上你会没事的。
如果有兴趣,在我目前没有的空闲时间里,我可以发布一个快速工具来在 Codeplex 上执行此操作。
** 注意:因为我们正在使用 XML,并且 XML 非常注重正确性,所以我关闭了表达式混合,然后在替换/重命名后再次重新打开它,看看我是否成功 + 我的屏幕图仍然具有所有流程线条仍然画在里面。
how do we rename .xaml and .cs files?
would like to be able to keep development in synch with the original sketchflow. i.e. sketchflow has features such as the ability to collect client feedback on a per screen basis, etc.
... I kind of answered my own question here, so I'll post it as a follow up. Asked the original question 9 hours ago on the MS site without response... still trying to work out where the best place is to talk to the community, so sorry for the duplicate.
THE ANSWER (IS THERE A BETTER ONE?)
Context: Sketchflow is a prototyping tool. In large teams possibly you want to keep the prototype seperate from the finished version, or there's a large prototyping phase.
My view is that I really like Sketchflow. It's one of the coolest things I've seen for a while (well done Microsoft).
... so for me, I want the prototype to become a the finished product. I want the designers to step in and make transitions whenever they want. I want the designers to kick the process off, and the developers to put in the detail. I'd like our customers to be able to post feedback at any time during the build process. btw: get your developers to check out MVVM. It's very cool.
My bet is that the feedback could get lost if you make a breaking change (a file rename) -- so just beware of that. That wont be a problem for us. We'll get our file names to make sense and then mostly leave it alone. Of course MS could fix this this by creating a globally unique id (Guid) for each screen that is created. Perhaps they've done this already. If someone from MS reads this, please put this on your requested features list.
THE ANSWER:
So here is the answer that works for me:
don't try to hand-edit the xaml / cs, as all the cross referencing that you might be doing with behaviors will break if you aren't really careful. Typical files that need to be modified: .csproj, Sketch.Flow, xxxx.xaml, and xxxx.cs.
To auto do it, download a tool like Ultraedit. Alternatively, you might be able to just use VS 2010 (untested).
Steps with ultraedit:
(BACKUP YOUR PROJECT FIRST)
Search/Replace In Files...
Find in files... "Screen_1_19"
Replace with... "Welcome"
In Files/Types... "."
Directory...
Match Whole Word Only
Hit "Start"
follow the prompts
rename the files (.xaml & .cs) to be Welcome.???? (where ???? is .xaml or .cs) . Since I use SVN, this step gets done for me in one step (no big deal).
- If using VS2010 for steps 1 through 8, be careful do longer string replacements first e.g. Screen_1_19 before Screen_1. I think VS treats _ as a word break. On ultraedit you'll be fine.
If there's interest, in the spare time that I don't currently have, I could release a quick tool to do this on codeplex.
** note: because we are working with XML and XML is very particular about being correct, I close expression blend down, and then reopen it again after the replace/rename to see if I was successful + my screen map still has all the flow lines still drawn in.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
答案位于问题正文上方。
answer is above in the body of the question.