带按钮的WPF样式窗口 [英] WPF styling window with buttons

查看:111
本文介绍了带按钮的WPF样式窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好!

我正在开发窗口样式,该样式提供了很少放置在窗口上的按钮.关键是开发人员参考了我们的风格,并准备好与我们公司一起使用对话框.只需在按钮后面添加行为,然后在表单等上添加更多元素即可.

问题是开发人员可以获取这些按钮,但是不能.

Hi all!

Im developing window style which provides few buttons placed on the window. The point is that developer refers our style and gets ready to use dialog with our company look on it. Just add behaviour behind buttons and maybe add more uielements on the form etc.

The problem is that developer gets those buttons but cannot eg. hook any button events like normally.

推荐答案

您必须创建一个开发人员可以继承的类,并在该类中为按钮创建事件.因此,假设您有一个OK按钮,则在您的类中处理click事件,然后引发子类可以处理的OKButtonClicked事件.
You''ll have to create a class the developer can inherit, and in this class you create events for the buttons. So say you have an OK button you handle the click event in your class and then raise your OKButtonClicked event which subclasses can handle.


这篇关于带按钮的WPF样式窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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