NavigationAction Parameters

Mar 15, 2011 at 9:25 AM


The following code passes null into the OnInitialise event of the VM URL in NavigateAction. I think this is because of the order of binding. ie The SelectedItem has not been set yet by the Listbox.

Do you have a recommended approach on passing the parameter on the same trigger as being set?					

 <ListBox Grid.Row="5" BorderThickness="0" SelectedItem="{Binding SelectedItem, Mode=TwoWay}" ItemsSource="{Binding Jobs}">
						<i:EventTrigger EventName="SelectionChanged">
							<n:NavigateAction Url="Views/Checklist/">
								<n:DependencyParameter Key="JobID" Value="{Binding SelectedItem}"/>




Mar 16, 2011 at 8:09 AM

I think you'd be better off binding to the element directly, as in bind to the ListBox's SelectedItem directly rather than going to the back-end. Now, as for the reasons why it's setting null, it could either be a timing issue or something with your code - I can't tell off head.