(WPF Studio, latest version)
Hi Guys,
Hopefully this will be easy to point me in the right direction.
When working with the NavigationBar I am using the SelectionChanged event to detect when a user chooses a nav Pane, which then brings up the main application window's content for that context (client data, job data etc).
I've gotten this working kind of, but am having some trouble managing the event.
1. Although the event is Changed (rather than Changing) the SelectedItem property doesn't update until after the event is fired. This doesn't seem to be the way other selectors work with the SelectionChanged event in WPF?
2. The SelectionChanged event for the NavBar fires when the selection of any NavPane's child items is changed. IE, if I have a ComboBox in the Pane's controls and the selection of the combo box is changed, the NavBar's main SelectionChanged event fires, with the Bar itself as the sender.
Is this by design? Perhaps a quirk of WPF I'm unware of?
The combination of the two behaviours is making management of events in the NavBar rather awkward and cumbersome. I get the feeling I'm writing more code than I should be, ie type checks in the selection event's added and removed items collections in order to determine exactly what is being changed ...
Am I going about this the wrong way, or is there a change needed to address the above?
[Modified at 04/15/2009 12:30 AM]
Hi Guys,
Hopefully this will be easy to point me in the right direction.
When working with the NavigationBar I am using the SelectionChanged event to detect when a user chooses a nav Pane, which then brings up the main application window's content for that context (client data, job data etc).
I've gotten this working kind of, but am having some trouble managing the event.
1. Although the event is Changed (rather than Changing) the SelectedItem property doesn't update until after the event is fired. This doesn't seem to be the way other selectors work with the SelectionChanged event in WPF?
2. The SelectionChanged event for the NavBar fires when the selection of any NavPane's child items is changed. IE, if I have a ComboBox in the Pane's controls and the selection of the combo box is changed, the NavBar's main SelectionChanged event fires, with the Bar itself as the sender.
Is this by design? Perhaps a quirk of WPF I'm unware of?
The combination of the two behaviours is making management of events in the NavBar rather awkward and cumbersome. I get the feeling I'm writing more code than I should be, ie type checks in the selection event's added and removed items collections in order to determine exactly what is being changed ...
Am I going about this the wrong way, or is there a change needed to address the above?
[Modified at 04/15/2009 12:30 AM]