2

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}");

1 Answer 1

2

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.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.