使用 Blend 生成的 xaml
我们正在启动一个将使用 Prism 4 的 WPF 项目。
我们有一位设计师将使用 Blend / Sketchflow 设计屏幕。
我们原本想到的是使用Blend直接生成的xaml。但是,我们被告知,由于创建的 xaml 的可读性,这不是一个好主意。
有人有直接从 Blend 使用 xaml 的经验吗?您是否会推荐这个东西?
We are starting a WPF project that will use Prism 4.
We have a designer who will design the screens using Blend / Sketchflow.
We had originally thought of using the xaml that Blend generated directly. However, we have been advised that this is not a good idea due to the readibility of the xaml created.
Has anyone any experience with using the xaml directly from Blend? Is this something that you would recommend or not?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这完全取决于。 Blend,尤其是较新的版本,在创建合理的 xaml 方面做得相当好。
话虽这么说,它仍然是一个设计师 - 大多数设计师编写的代码与手工编写时所写的代码不同。在工作时“清理”设计的代码通常仍然很有用,因此了解 Blend 正在做什么会很有帮助。
话虽这么说,直接使用 Blend 的 xaml 没有问题,特别是如果您不需要/不想手动编辑它以添加其他功能,或者根本不需要在 Blend 之外使用它。
It completely depends. Blend, especially newer versions, does a fairly good job of creating reasonable xaml.
That being said, it's still a designer - most designers don't write the same code you would when writing by hand. It's often still useful to "clean up" the designed code as you're working, so understanding what Blend is doing can be helpful.
That being said, there is no problem with using Blend's xaml directly, especially if you don't need/want to hand edit it to add additional functionality, or work with it outside of Blend at all.
关于使用 Blend,我注意到的一件事是它使用的
Margin
,以及一般来说,Blend 会以多快的速度弄乱视图的布局。让我给你举个例子,当你在最初的网格上放置一个按钮时,除非你明确指定行/列,否则 Blend 只会设置一个边距你的按钮的地方。
这太糟糕了。
现在使用 Blend/Sketchflow 并不是一个坏主意,但是你的设计师绝对必须学习一些编程逻辑,至少是布局方面的东西。如果他要从头开始重新设计 UIElement,他的学习曲线就会像过山车一样......
One thing I've noticed about using Blend is the
Margin
it uses, and in general, how fast Blend can mess up the layout of your views.Let me give you an example, when you place let's say, a
Button
on your initialGrid
, unless you specify rows/columns explicitely, Blend will just put a Margin to set your Button's place.This is awful.
Now using Blend/Sketchflow is not a bad idea, but your designer will absolutely have to learn a bit of programmation logic, at least the layout things. And if he's going to re-style UIElement from scratch, he's in for a rollercoaster of a learning curve...