聆听由风格中的frameworkelement触发的事件

时间:2014-09-18 13:34:24

标签: wpf events styles

I have a TabControl with custom styled tabItems.
These items contains button via control template, to close the tab on click.

I dont know how to attach the event to the main thread (not codebehind in res dic)
The tabitems are added dynamically and shoudl be removed same way.

I think using EventSetter is the wrong way, since I read some of the solutions posted in here.
Commands may be wrong to, bcause I do not use mvvm.

th in a.

编辑:

我很抱歉因为我的问题不够清楚。所以这是一个更具体的问题:

我想要做的是在我的Tabcontrol的标签中添加一个关闭按钮。 我已经使用样式模板(部分:控制模板)执行此操作。

现在问题是,如何在主窗口中处理此按钮的点击事件?

0 个答案:

没有答案