public DialogHost(INavigationService navigationSvc)
            {
                this.navigationSvc = navigationSvc;

                currentPage = navigationSvc.CurrentContent as PhoneApplicationPage;
                if (currentPage == null)
                {
                    throw new InvalidOperationException(
                              string.Format("In order to use ShowDialog the view currently loaded in the application frame ({0})"
                                            + " should inherit from PhoneApplicationPage or one of its descendents.", navigationSvc.CurrentContent.GetType()));
                }

                navigationSvc.Navigating += OnNavigating;
                navigationSvc.Navigated  += OnNavigated;

                CreateUIElements();
                elementPlacementAnimator = CreateElementsAnimator();
            }
Exemplo n.º 2
0
            public DialogHost(INavigationService navigationSvc) {
                this.navigationSvc = navigationSvc;

                currentPage = navigationSvc.CurrentContent as PhoneApplicationPage;
                if (currentPage == null) {
                    throw new InvalidOperationException(
                        string.Format("In order to use ShowDialog the view currently loaded in the application frame ({0})"
                                      + " should inherit from PhoneApplicationPage or one of its descendents.", navigationSvc.CurrentContent.GetType()));
                }

                navigationSvc.Navigating += OnNavigating;
                navigationSvc.Navigated += OnNavigated;

                CreateUIElements();
                elementPlacementAnimator = CreateElementsAnimator();
            }
Exemplo n.º 3
0
 public DialogHost(PhoneApplicationPage currentPage) {
     this.currentPage = currentPage;
     CreateUIElements();
     elementPlacementAnimator = CreateElementsAnimator();
 }