I am using autofac in an UWP application. In my App
instance, I am setting up the dependency, like this:
public sealed partial class App
{
privat
I'm very new to UWP (but a very old hand at .NET/WPF etc etc), so this might be hacky, but I by-passed the Frame.Navigate method altogether by putting the following at the top of my OnLaunched method:
if (Window.Current.Content == null)
{
var windowFrame = new Frame()
{
Content = new MainPage()
};
Window.Current.Content = windowFrame;
Window.Current.Activate();
return;
}
You then control the creation of your mainpage - if you want to support DI, then you can use something like:
var windowFrame = new Frame()
{
Content = container.GetInstance()
};
This then means that MainPage becomes your CompositionRoot and your DI flows from there.
My guess is that you then don't get any navigate back/forward functionality, although I may be wrong...my app is only single-page so I've not seen if that is a problem or not...