【发布时间】:2010-08-19 12:33:23
【问题描述】:
我正在扩展 WPF 日历控件,并将 Calendar、CalendarItem、CalendarButton 和 CalendarDayButton 的控件模板复制到我的自定义控件的Generic.xaml。 Calendar 控件模板的 TargetType 是我的自定义控件 FsCalendar:
<!-- Calendar Control Template -->
<Style TargetType="{x:Type local:FsCalendar}">
...
</Style>
但是其他控件模板呢?我是否像这样将它们定位在原始日历上?
<!-- CalendarDayButton Control Template -->
<Style TargetType="CalendarDayButton">
...
</Style>
或者我是否将它定位到我的自定义控件?如果是这样,我该怎么做?
我尝试将我的命名空间 (local) 放入声明中,但这不起作用。因此,就目前而言,TargetType 设置为默认的System.Windows.Controls.Primitives 命名空间。
感谢您的帮助。
【问题讨论】:
标签: wpf custom-controls