Reputation: 2022
When in try to pass complex object as parameter, it just passes the typename of the Object. What are the options to pass in complex Object when navigating to different component/page ?
This is what i have tried @page "/showLocation/{SelectedOrgLocation}"
Page which is sending information navManager.NavigateTo($"ShowLocation?SelectedOrgLocation={data}");
Upvotes: 2
Views: 2473
Reputation: 204
The {data} object will be converted into its string representation as used with string interpolation (i.e. $"any string with {placeholder}") and hence the behavior.
Also, Routes are Uri strings and so is the NavigateTo() method's uri parameter. So, complex types can not be provided as parameters via Navigation. You should rather pass identifying value (string/int) for SelectedOrgLocation as route parameter and fetch the location object using that identifier inside the navigated component.
Upvotes: 2