code_junkie

How do I update a label that is in a ControlTemplate of a Toolbar in WPF?

Nov 11th, 2011
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.80 KB | None | 0 0
  1. <Style x:Key="DocViewerToolBarStyle" TargetType="{x:Type ContentControl}">
  2. <Setter Property="Template">
  3. <Setter.Value>
  4. <ControlTemplate TargetType="{x:Type ContentControl}">
  5. <ToolBarTray... />
  6. <ToolBar.../>
  7. <Button../>
  8. <Button..>
  9.  
  10. <Label x:Name="myStatusLabel" .. />
  11.  
  12. <Label x:Name="myStatusLabel" Content={TemplateBinding MyStatusLabelProperty} ../>
  13.  
  14. <Label x:Name="myStatusLabel" Content="{TemplateBinding Content}"/>
  15.  
  16. <DataTemplate DataType={x:Type viewmodel:MyToolBarViewModel}>
  17. <Label Content={Binding CurrentPage} />
  18. <Label Content={Binding TotalPages} ContentStringFormat="{}of {0}" />
  19. </DataTemplate>
  20.  
  21. <ToolBar>
  22. <ContentPresenter Content={Binding <PathtoViewModel>} />
  23. </ToolBar>
Add Comment
Please, Sign In to add comment