Answered by:

using navigation buttons

Question

is there a way to use the navigation buttons which NavigationWindow uses alone? I mean I just to use those buttons and implement my own functionality because the possibilities of NavigationWindow or Frame doesn't fit my requirements.

If someone is interested in my problem. I am trying to implement a dynamic queue. The content of the queue should be displayed and you should be able to navigate through the queue with the navigation buttons. According that the queue is getting changed asynchron in the background I can't really use NavigationWindow or Frame.

Does anyone can answer me my first question or has an approch how to solve my problem????

Answers

I'm not sure what your problem is. If you have difficulty using the tool, just use this code snippet to extract NavigationWindow's default style. [Note: There seems to be a typo: The method name is FindResource().] Or just use the copy I put here.

The navigation buttons will appear disabled normally. That's because they are tied to the navigation commands (BrowseBack/BrowseForward). There are ControlTemplate triggers that respond to changes to the IsEnabled property. If there is a handler for these commands along the normal route the commands are bubbled through, the buttons will become enabled. (You could set the buttons' CommandTarget explicitly.)

You shouldn't use this style literally. Rather, it can just give you an idea of what's in the built-in ControlTemplate, and you can, of course, reuse pieces of it (like the button graphics).

How do you expect this Syle to be applied to your buttons? You have to either set the Button.Style property to refer to the style or set Style.TargetType so that the framework can find the style automatically.

All replies

You could extract the built-in ControlTemplate of NavigationWindow and tie your custom logic to it. You may choose to change the commands that the buttons generate or just set up handlers for NavigationCommands.BrowseBack & .BrowseForward. Here's one tool to view the built-in styles: http://www.codeplex.com/TemplateViewer.

I'm not sure what your problem is. If you have difficulty using the tool, just use this code snippet to extract NavigationWindow's default style. [Note: There seems to be a typo: The method name is FindResource().] Or just use the copy I put here.

The navigation buttons will appear disabled normally. That's because they are tied to the navigation commands (BrowseBack/BrowseForward). There are ControlTemplate triggers that respond to changes to the IsEnabled property. If there is a handler for these commands along the normal route the commands are bubbled through, the buttons will become enabled. (You could set the buttons' CommandTarget explicitly.)

You shouldn't use this style literally. Rather, it can just give you an idea of what's in the built-in ControlTemplate, and you can, of course, reuse pieces of it (like the button graphics).

How do you expect this Syle to be applied to your buttons? You have to either set the Button.Style property to refer to the style or set Style.TargetType so that the framework can find the style automatically.