silverlight 中的自定义按钮
我怎样才能在 silverlight 中创建这样的按钮。我需要表达混合吗?
由于我需要在应用程序中的许多地方使用修改后的按钮,我应该将其作为用户控件来执行吗?
How can I create buttons like this in silverlight. Do I need expression blend for this.
Since I need to use the modified buttons at many places in my application, should I do it as a user control?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
为此,您不需要
UserControl
,只需一个自定义Button
模板作为样式资源,然后您可以通过在任何Button< 上设置样式来重用该模板/代码> 实例。
虽然无需 Blend 也可以实现,但我强烈建议您至少试用一下,它对于设计/视觉开发来说是一个非常非常好的 IDE!
编辑:作为一个小礼物,这是一个起点:)
You don't need a
UserControl
for this, just a customButton
template as a style resource, which then you can reuse by setting the style on anyButton
instance.While it's doable without Blend, I highly recommend you at least get the trial, it's a really really nice IDE for design / visual development!
Edit: As a little present here's a starting point :)
您可以在不使用 Blend 的情况下手动完成此操作,但请相信我,使用 Blend 将为您提供更多功能,并且如果您决定自己完成这一切,您将在所需的时间内获得更惊人的结果。
You can do it without Blend by hand, but believe me, using Blend will give you a lot more power and you'll get more amazing results in the fraction of time you would need if you decided to do it all by yourself.
我绝对推荐 Blend,因为它可以在设计控件样式和创建模板时节省大量时间。
但是,如果您不希望按钮完全与图像相同,则可以使用多个主题(例如JetPack),您可以从中借用模板并在 XAML 中相对轻松地修改颜色。
I'd definitely recommend Blend as it saves so much time when styling controls and creating templates.
However, if you're not set on having the buttons exactly the same as the image, there are several themes that you could use (such as JetPack) from which you could borrow the templates and amend the colours relatively easily in XAML.