Beispiel #1
0
        protected override UIElement CreateShell(Frame rootFrame)
        {
            rootFrame.CacheSize = 5;

            rootFrame.Navigating       += RootFrame_Navigating;
            rootFrame.NavigationFailed += RootFrame_NavigationFailed;

            var menuPageBase = new Views.MenuNavigatePageBase();

            menuPageBase.Content = rootFrame;

#if DEBUG
            menuPageBase.FocusEngaged += Container_FocusEngaged;
#endif
            var grid = new Grid();

            grid.Children.Add(menuPageBase);

            var hohoemaInAppNotification = new Views.HohoemaInAppNotification();
            hohoemaInAppNotification.VerticalAlignment = VerticalAlignment.Bottom;
            grid.Children.Add(hohoemaInAppNotification);


            return(grid);
        }
Beispiel #2
0
        UIElement CreateShell()
        {
            // Grid
            //   |- HohoemaInAppNotification
            //   |- PlayerWithPageContainerViewModel
            //   |    |- MenuNavigatePageBaseViewModel
            //   |         |- rootFrame

            var primaryWindowCoreLayout  = Container.Resolve <Views.PrimaryWindowCoreLayout>();
            var hohoemaInAppNotification = new Views.HohoemaInAppNotification()
            {
                VerticalAlignment = VerticalAlignment.Bottom
            };

            var grid = new Grid()
            {
                Children =
                {
                    primaryWindowCoreLayout,
                    hohoemaInAppNotification,
                    new Views.NoUIProcessScreen()
                }
            };

            var primaryWindowContentNavigationService = primaryWindowCoreLayout.CreateNavigationService();

            Container.GetContainer().RegisterInstance(primaryWindowContentNavigationService);

            var primaryViewPlayerNavigationService = primaryWindowCoreLayout.CreatePlayerNavigationService();
            var name = "PrimaryPlayerNavigationService";

            Container.GetContainer().RegisterInstance(name, primaryViewPlayerNavigationService);



#if DEBUG
            primaryWindowCoreLayout.FocusEngaged += (__, args) => Debug.WriteLine("focus engagad: " + args.OriginalSource.ToString());
#endif

            return(grid);
        }
Beispiel #3
0
        protected override UIElement CreateShell(Frame rootFrame)
        {
            rootFrame.CacheSize = 5;

            rootFrame.NavigationFailed += (_, e) =>
            {
                Debug.WriteLine("Page navigation failed!!");
                Debug.WriteLine(e.SourcePageType.AssemblyQualifiedName);
                Debug.WriteLine(e.Exception.ToString());

                _ = OutputErrorFile(e.Exception, e.SourcePageType?.AssemblyQualifiedName);
            };


            // Grid
            //   |- HohoemaInAppNotification
            //   |- PlayerWithPageContainerViewModel
            //   |    |- MenuNavigatePageBaseViewModel
            //   |         |- rootFrame

            var menuPageBase = new Views.MenuNavigatePageBase()
            {
                Content     = rootFrame,
                DataContext = Container.Resolve <ViewModels.MenuNavigatePageBaseViewModel>()
            };


            Views.PlayerWithPageContainer playerWithPageContainer = new Views.PlayerWithPageContainer()
            {
                Content     = menuPageBase,
                DataContext = Container.Resolve <ViewModels.PlayerWithPageContainerViewModel>()
            };

            playerWithPageContainer.ObserveDependencyProperty(Views.PlayerWithPageContainer.FrameProperty)
            .Where(x => x != null)
            .Take(1)
            .Subscribe(async frame =>
            {
                var frameFacade = new FrameFacadeAdapter(playerWithPageContainer.Frame, EventAggregator);

                var sessionStateService = new SessionStateService();
                var ns = new FrameNavigationService(frameFacade
                                                    , (pageToken) =>
                {
                    if (pageToken == nameof(Views.VideoPlayerPage))
                    {
                        return(typeof(Views.VideoPlayerPage));
                    }
                    else if (pageToken == nameof(Views.LivePlayerPage))
                    {
                        return(typeof(Views.LivePlayerPage));
                    }
                    else
                    {
                        return(typeof(Views.BlankPage));
                    }
                }, sessionStateService);

                var name = nameof(PlayerViewManager.PrimaryViewPlayerNavigationService);
                Container.RegisterInstance(name, ns as INavigationService);
            });



            var hohoemaInAppNotification = new Views.HohoemaInAppNotification()
            {
                VerticalAlignment = VerticalAlignment.Bottom
            };

            var grid = new Grid()
            {
                Children =
                {
                    playerWithPageContainer,
                    hohoemaInAppNotification,
                }
            };


#if DEBUG
            menuPageBase.FocusEngaged += (__, args) => Debug.WriteLine("focus engagad: " + args.OriginalSource.ToString());
#endif

            return(grid);
        }
Beispiel #4
0
        UIElement CreateShell(out Frame rootFrame)
        {
            rootFrame           = new Frame();
            rootFrame.CacheSize = 5;

            rootFrame.NavigationFailed += (_, e) =>
            {
                Debug.WriteLine("Page navigation failed!!");
                Debug.WriteLine(e.SourcePageType.AssemblyQualifiedName);
                Debug.WriteLine(e.Exception.ToString());

                _ = OutputErrorFile(e.Exception, e.SourcePageType?.AssemblyQualifiedName);
            };


            rootFrame.Navigating += (_, e) =>
            {
                var pageManager = Container.Resolve <PageManager>();
                pageManager.RefrectNavigating(e);
            };

            rootFrame.Navigated += (_, e) =>
            {
                var pageManager = Container.Resolve <PageManager>();
                pageManager.RefrectNavigationState(e);
            };
            rootFrame.NavigationFailed += (_, e) =>
            {
                var pageManager = Container.Resolve <PageManager>();
                pageManager.RefrectNavigateFailed(e);
            };
            // Grid
            //   |- HohoemaInAppNotification
            //   |- PlayerWithPageContainerViewModel
            //   |    |- MenuNavigatePageBaseViewModel
            //   |         |- rootFrame

            var menuPageBase = new Views.MenuNavigatePageBase()
            {
                Content = rootFrame,
            };


            Views.PlayerWithPageContainer playerWithPageContainer = new Views.PlayerWithPageContainer()
            {
                Content = menuPageBase,
            };

            playerWithPageContainer.ObserveDependencyProperty(Views.PlayerWithPageContainer.FrameProperty)
            .Where(x => x != null)
            .Take(1)
            .Subscribe(async frame =>
            {
                var ns = Prism.Navigation.NavigationService.Create(playerWithPageContainer.Frame);

                var name = nameof(PlayerViewManager.PrimaryViewPlayerNavigationService);
                Container.GetContainer().RegisterInstance(name, ns as INavigationService);
            });



            var hohoemaInAppNotification = new Views.HohoemaInAppNotification()
            {
                VerticalAlignment = VerticalAlignment.Bottom
            };

            var grid = new Grid()
            {
                Children =
                {
                    playerWithPageContainer,
                    hohoemaInAppNotification,
                }
            };


#if DEBUG
            menuPageBase.FocusEngaged += (__, args) => Debug.WriteLine("focus engagad: " + args.OriginalSource.ToString());
#endif

            return(grid);
        }