I need to create a shell for my application that does not change which contains the frame that should be used to change the apps content. I tried this (code is below), but get a NullReferenceException because of the call order.
Is there an easy way to archive this ?
sealed partial class App : PrismUnityApplication
{
protected override UIElement CreateShell(Frame rootFrame)
{
return new Views.ShellView();
}
protected override INavigationService CreateNavigationService(IFrameFacade rootFrame, ISessionStateService sessionStateService)
{
var frame = (Shell as Views.ShellView).ContentFrame;
var adapter = new FrameFacadeAdapter(frame, EventAggregator);
var navigationService = OnCreateNavigationService(adapter) ?? new FrameNavigationService(adapter, GetPageType, sessionStateService);
return navigationService;
}
....
}
Maybe this can help you
In App.xaml.cs
protected override UIElement CreateShell(Frame rootFrame)
{
var shell = Container.Resolve<AppShell>();
shell.SetContentFrame(rootFrame);
return shell;
}
In AppShel.xaml.cs
public void SetContentFrame(Frame frame)
{
RootSplitView.Content = frame;
}
In AppShell.xaml
<SplitView x:Name="RootSplitView">
<SplitView.Content>
<Frame x:Name="ContentFrame" />
</SplitView.Content>
</SplitView>

works as described above. Thanks
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
Most helpful comment
Maybe this can help you
In App.xaml.cs
In AppShel.xaml.cs
In AppShell.xaml