Exemplo n.º 1
0
        //We want the selected bar to go to the top
        //to re-order the selected bar to leftmost content orientation
        //to collapse all others
        //to show the content browser and "back" viel over collapsed items
        //to populate the content browser
        void thisBar_ContentPressed(ItemBar sender, Uri uri)
        {
            if ((sender as ItemBar).barState == Enums.ItemBarState.FULL)
            {
                //Move selected to top, set proper layouts
                List <ItemBar> tmpPost = new List <ItemBar>();
                tmpPost.Add(sender);
                sender.changeToState(Enums.ItemBarState.COLLAPSED_FOCOUSED);

                foreach (UIElement child in unModeratedStack.Children)
                {
                    if (!tmpPost.Contains(child as ItemBar))
                    {
                        tmpPost.Add(child as ItemBar);
                        (child as ItemBar).changeToState(Enums.ItemBarState.COLLAPSED_UNFOCUSED);
                    }
                }

                unModeratedStack.Children.Clear();

                foreach (ItemBar itemBar in tmpPost)
                {
                    unModeratedStack.Children.Add(itemBar);
                }


                //Do content
                unmoderatedContentControl.Visibility = System.Windows.Visibility.Visible;
                unmoderatedContentControl.loadContent(uri);
            }
        }