Permalink
Browse files

Switch to looking up via UIViewController so it's easier to use the R…

…outerUINavigationViewController
  • Loading branch information...
1 parent 2f198f3 commit 0b827fcb4bf278330173d13198b93a4d9b88c36b @paulcbetts paulcbetts committed Mar 20, 2013
Showing with 6 additions and 3 deletions.
  1. +6 −3 ReactiveUI.Mobile/AutoSuspendAppDelegate.cs
@@ -106,10 +106,13 @@ internal void setupDefaultSuspendResume(ISuspensionDriver driver)
var window = new UIWindow(UIScreen.MainScreen.Bounds);
_viewModelChanged.Subscribe(vm => {
- var frame = RxApp.GetService<IViewFor>("InitialPage");
- frame.ViewModel = vm;
+ var frame = RxApp.GetService<UIViewController>("InitialPage");
+ var viewFor = frame as IViewFor;
+ if (viewFor != null) {
+ viewFor.ViewModel = vm;
+ }
- window.RootViewController = (UIViewController)frame;
+ window.RootViewController = frame;
window.MakeKeyAndVisible();
});

0 comments on commit 0b827fc

Please sign in to comment.