Template10 icon indicating copy to clipboard operation
Template10 copied to clipboard

Why haven't we implemented auto-discover for Nav/Pages?

Open JerryNixon opened this issue 5 years ago • 1 comments

Right now you have to do this if you want to navigate to Settings.

public override void RegisterTypes(IContainerRegistry container)
{
    container.RegisterView<SettingsPage, SettingsPageViewModel>();
}

Even if all you are doing is this:

public override void RegisterTypes(IContainerRegistry container)
{
    container.RegisterView<SettingsPage>();
}

I guess I have forgotten why we don't support navigating to a page by using a hunt for the type based on the key passed to the NavigationService. I can't remember the reason we would not have done this and it seems like conventions-based should handle most use cases, which would make the RegisterTypes() method considerably smaller/simpler/easier. It would also enable simple apps to just plug and play.

What am I missing?

JerryNixon avatar Dec 17 '19 23:12 JerryNixon

Maybe .NET Native reflection limitations?

tibitoth avatar Dec 18 '19 09:12 tibitoth