public ExperienceDayPage()
        {
            ExperienceDayPage.Current = this;

            InitializeComponent();

            this.Loaded += this.ExperienceDayPage_Loaded;
        }
Пример #2
0
        private void BottomNavBar_OnNavigation(object sender, NavigateEventArgs e)
        {
            // stop the page timer
            if (null != _pageMoveTimer)
            {
                _pageMoveTimer.Stop();
            }

            // if we have a flipview
            if (null != this.ContentFlipView)
            {
                // get the sender
                if (sender is NavigationBar navBar)
                {
                    // get the page index
                    int pageIndex = navBar.Root.SelectedIndex;

                    // move the flipview to that index
                    if (pageIndex != this.ContentFlipView.SelectedIndex)
                    {
                        this.ContentFlipView.SelectedIndex = pageIndex;
                    }

                    // get the slider flipview page index
                    INavigationItem sliderItem = navBar.Root.Items.Find(item => item.Name == "ExperienceDayPage");
                    if ((null != sliderItem) && (sliderItem is NavigationFlipView sliderNavigationFlipView))
                    {
                        FlipViewEx dayFlipView = ExperienceDayPage.GetDayFlipView();

                        if ((null != ExperienceDayPage.Current) && (null != dayFlipView))
                        {
                            if (dayFlipView.SelectedIndex != sliderNavigationFlipView.SelectedIndex)
                            {
                                dayFlipView.SelectedIndex = sliderNavigationFlipView.SelectedIndex;
                            }
                        }
                    }

                    // telemetry - log section nav
                    if (NavigationActions.Section == e.NavAction)
                    {
                        // we've gone to a section, so log it
                        switch (e.NavSection.Name)
                        {
                        case "Experience":
                            TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.NavExperience);
                            break;

                        case "Accessories":
                            TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.NavAccessories);
                            break;

                        case "BestOfMicrosoft":
                            TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.NavBestOf);
                            break;

                        case "Compare":
                            TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.NavComparison);
                            break;
                        }
                    }
                }
            }

            // telemetry - log nav sections
            if (NavigationActions.Section == e.NavAction)
            {
                // we've gone to a section, so log it
                switch (e.NavSection.Name)
                {
                case "Experience":
                    TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.NavExperience);
                    break;

                case "Accessories":
                    TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.NavAccessories);
                    break;

                case "BestOfMicrosoft":
                    TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.NavBestOf);
                    break;

                case "Compare":
                    TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.NavComparison);
                    break;
                }
            }

            // telemetry - log page view
            switch (e.NavItem.Section.Name)
            {
            case "Experience":
                TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.ViewExperience);
                break;

            case "Accessories":
                TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.ViewAccessories);
                break;

            case "BestOfMicrosoft":
                TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.ViewBestOf);
                break;

            case "Compare":
                TelemetryService.Current?.LogTelemetryEvent(TelemetryEvents.ViewComparison);
                break;
            }
        }
 private void RaiseSelectionChangedEvent(ExperienceDayPage sender)
 {
     this.RaiseSelectionChangedEvent(sender, new EventArgs());
 }
 private void RaiseSelectionChangedEvent(ExperienceDayPage sender, EventArgs e)
 {
     SelectionChanged?.Invoke(sender, e);
 }