/**
             * The constructor
             */
            public TabScreen()
                : base()
            {
                mPivot = new Microsoft.Phone.Controls.Pivot();

                //Setting the content of the View property of a Screen (which is a PhoneApplicationPage)
                //as the Pivot control
                (View as Microsoft.Phone.Controls.PhoneApplicationPage).Content = mPivot;
            }
            /**
             * The constructor
             */
            public TabScreen()
                : base()
            {
                mPivot = new Microsoft.Phone.Controls.Pivot();

                //Setting the content of the View property of a Screen (which is a PhoneApplicationPage)
                //as the Pivot control
                mPage.Children.Add(mPivot);
                Grid.SetColumn(mPivot, 0);
            }
Beispiel #3
0
            /**
             * Handles the back button pressed event.
             * @return true if the event has been consumed, false otherwise.
             */
            public override bool HandleBackButtonPressed()
            {
                Microsoft.Phone.Controls.Pivot pivot = this.mPivot;
                //If the selected tab is a StackScreen.
                if (this.mChildren[pivot.SelectedIndex] is StackScreen)
                {
                    //If pop is possible.
                    if ((this.mChildren[pivot.SelectedIndex] as StackScreen).StackCount() > 1 && (this.mChildren[pivot.SelectedIndex] as StackScreen).GetBackButtonEnabled() == true)
                    {
                        //Do a pop and cancel the event.
                        (this.mChildren[pivot.SelectedIndex] as StackScreen).PopFromBackButtonPressed();
                        return true;
                    }
                }

                return false;
            }
Beispiel #4
0
            /**
             * The constructor
             */
            public TabScreen()
                : base()
            {
                mPivot = new Microsoft.Phone.Controls.Pivot();

                mApplicationBarItemsIndexes = new Dictionary<Object, int>();

                //The application bar is chanded at the SelectionChanged event occurence.
                //This allows the user to have more that one application bar / tabScreen
                mPivot.LoadedPivotItem += new EventHandler<Microsoft.Phone.Controls.PivotItemEventArgs>(
                    delegate(object from, Microsoft.Phone.Controls.PivotItemEventArgs target)
                    {
                        bool appBarVisible = (this.mChildren[(from as Microsoft.Phone.Controls.Pivot).SelectedIndex] as Screen).GetApplicationBarVisibility();
                        if (appBarVisible)
                        {
                            mApplicationBar = (this.mChildren[(from as Microsoft.Phone.Controls.Pivot).SelectedIndex] as Screen).GetApplicationBar();
                            mApplicationBar.IsVisible = true;
                            ((Application.Current.RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame).Content as
                                Microsoft.Phone.Controls.PhoneApplicationPage).ApplicationBar = mApplicationBar;
                            this.SetApplicationBarVisibility(true);
                        }
                        else
                        {
                            this.SetApplicationBarVisibility(false);
                            if (((Application.Current.RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame).Content as
                                Microsoft.Phone.Controls.PhoneApplicationPage).ApplicationBar != null)
                            {
                                ((Application.Current.RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame).Content as
                                Microsoft.Phone.Controls.PhoneApplicationPage).ApplicationBar.IsVisible = false;
                            }
                        }
                    });

                //Setting the content of the View property of a Screen (which is a PhoneApplicationPage)
                //as the Pivot control
                mPage.Children.Add(mPivot);
                Grid.SetColumn(mPivot, 0);
                Grid.SetRow(mPivot, 0);
            }
Beispiel #5
0
            /**
             * The constructor
             */
            public TabScreen() : base()
            {
                mPivot = new Microsoft.Phone.Controls.Pivot();

                mApplicationBarItemsIndexes = new Dictionary<Object, int>();

                //The application bar is chanded at the SelectionChanged event occurence.
                //This allows the user to have more that one application bar / tabScreen
                mPivot.LoadedPivotItem += new EventHandler<Microsoft.Phone.Controls.PivotItemEventArgs>(
                    delegate(object from, Microsoft.Phone.Controls.PivotItemEventArgs target)
                    {
                        bool appBarVisible = (this.mChildren[(from as Microsoft.Phone.Controls.Pivot).SelectedIndex] as Screen).GetApplicationBarVisibility();
                        if (appBarVisible)
                        {
                            mApplicationBar = (this.mChildren[(from as Microsoft.Phone.Controls.Pivot).SelectedIndex] as Screen).GetApplicationBar();
                            mApplicationBar.IsVisible = true;
                            ((Application.Current.RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame).Content as
                                Microsoft.Phone.Controls.PhoneApplicationPage).ApplicationBar = mApplicationBar;
                            this.SetApplicationBarVisibility(true);
                        }
                        else
                        {
                            this.SetApplicationBarVisibility(false);
                            if (((Application.Current.RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame).Content as
                                Microsoft.Phone.Controls.PhoneApplicationPage).ApplicationBar != null)
                            {
                                ((Application.Current.RootVisual as Microsoft.Phone.Controls.PhoneApplicationFrame).Content as
                                Microsoft.Phone.Controls.PhoneApplicationPage).ApplicationBar.IsVisible = false;
                            }
                        }
                    });

                //Setting the content of the View property of a Screen (which is a PhoneApplicationPage)
                //as the Pivot control
                mPage.Children.Add(mPivot);
                Grid.SetColumn(mPivot, 0);
                Grid.SetRow(mPivot, 0);
            }