我有一個由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