我有一个由ToolBarTray和ToolBar组成的ControlTemplate。在我的工具栏中,我有几个按钮,然后是一个标签。我希望能够更新我的工具栏中的标签,例如“1/10”如何更新WPF中工具栏的ControlTemplate中的标签?
我的第一个想法是以编程方式查找标签并对其进行设置,但我在阅读时应该使用触发器完成此操作。我很难理解如何做到这一点。有任何想法吗?
<Style x:Key="DocViewerToolBarStyle" TargetType="{x:Type ContentControl}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ContentControl}">
<ToolBarTray... />
<ToolBar.../>
<Button../>
<Button..>
<Label x:Name="myStatusLabel" .. />
在哪里以及如何创建MyStatusLabelProperty? – ScottG 2008-10-22 18:15:58