I want to pass list of checked Id (checkedParcels) to another page to display list of details accordingly.
For this in first ViewModel I have implemented command on which execution I am able to navigate to another page. Here is that code:
Uri uri = new Uri("/UnitListForParcelPage?checkedParcel=" + checkedParcels,UriKind.Relative);
navigationService.NavigateTo(uri);
I am able to navigate to second page here is address as it shown in browser:
http://example.com/PropMgmtTestPage.aspx#/UnitListForParcelPage?checkedParcel=System.Linq.Enumerable+WhereEnumerableIterator%601%5BPropMgmt.ParcelServiceRef.Parcel%5D
My problem is I am using ViewModel to perform operation on this page but I am unable to find any method to access value passed through query string.
Update: On page code-behind I have added this code:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
string PSTR = NavigationContext.QueryString["checkedParcel"];
MessageBox.Show(PSTR);
}
MessageBox is showing correct value now I just want to bind that to viewmodel property
I have used this approch to bind viewmodel to view:
<navigation:Page.Resources>
<helpers:SimpleViewModelLocator ViewModelKey="UnitTransFormViewModel" x:Key="viewModelLocator"/>
</navigation:Page.Resources>
<navigation:Page.DataContext>
<Binding Source="{StaticResource viewModelLocator}" Path="ViewModel"/>
</navigation:Page.DataContext>