Example #1
0
        public void SetNavigationState(App.NavigationStates state)
        {
            if (CurrentNavigationState != state)
            {
                CurrentNavigationState = state;
                ((App)Application.Current).lastNavState = state;
                InitializeGridView(state);
            }
            //add text to pick an app for search/share
            Breadcrumb        bc;
            List <Breadcrumb> b = new List <Breadcrumb>();

            if (CurrentNavigationState == App.NavigationStates.Search)
            {
                bc = new Breadcrumb(App.Apps.NoPage, true, "Select an app to search...");

                //this.title.ButtonOpacity = 1;
                //This is a small hack to allow the back arrow to bring the user back to a normal main page after searching
                ((App)Application.Current).lastNavState = App.NavigationStates.Normal;
            }
            else if (CurrentNavigationState == App.NavigationStates.Share)
            {
                bc = new Breadcrumb(App.Apps.NoPage, true, "Share to...");
            }
            else
            {
                bc = new Breadcrumb(App.Apps.NoPage, true, App.AppName);
            }

            b.Add(bc);
            this.title.SetupBreadcrumbs(b);
        }
Example #2
0
        //Need to handle snapping
        private void SetupBreadcrumbs(List <Breadcrumb> breadcrumbs, bool copyLocal)
        {
            if (copyLocal)
            {
                this.crumbs = breadcrumbs;
            }

            // if in snapped mode
            if (App.CurrentView == App.ViewModelStates.Snapped)
            {
                this.stackCrumbs.Children.Clear();
                Breadcrumb bc = crumbs.Last();

                //Create a textblock
                TextBlock tb = new TextBlock();
                tb.Style      = this.Resources["BreadcrumbStyle"] as Style;
                tb.Margin     = new Thickness(0, 15, 0, 0);
                tb.Text       = bc.TitleText;
                tb.Foreground = Helpers.GetBrush(Helpers.Colors.Black);

                this.stackCrumbs.Children.Add(tb);
            }

            // if we're not in snapped mode
            else
            {
                this.stackCrumbs.Children.Clear();
                for (int i = 0; i < breadcrumbs.Count; i++)
                {
                    Breadcrumb bc = breadcrumbs[i];
                    Utilities.Common.BreadCrumbItem bci = new Common.BreadCrumbItem(bc.TargetPage, App.NavigationStates.Normal, bc.TitleText, i, bc.IsLast);

                    // tilt effects
                    Callisto.Effects.Tilt.SetIsTiltEnabled(bci, true);

                    this.stackCrumbs.Children.Add(bci);
                }
            }
        }