Ejemplo n.º 1
0
        public DataSource()
        {
            //Windows Store Application
            //	Welcome to CSG Pro
            //		Meet the CSG Management Team
            //		Where We Work
            //		Learn Our History

            var group1 = new PitchItemGroup(
                "WindowsStoreApplication",
                "Windows Store Application");

            var welcomeToCSGPro = new PitchItem(
                "WelcomeToCSGProLanding",
                "Welcome to CSG Pro",
                "Let us put a smile on your face. Learn more about CSG Pro.",
                null,
                null,
                "Assets/PhotoChick1.jpg",
                null,
                PageColorScheme.Dark,
                HomeTileLayout.ExtraWide,
                group1);
            group1.Items.Add(welcomeToCSGPro);
            this.AllItems.Add(welcomeToCSGPro);

            var meetTheTeam = new PitchItem(
                "MeetTheTeam",
                "Meet the CSG Management Team",
                parentPitchItem: welcomeToCSGPro);
            var whereWeWork = new PitchItem(
                "WhereWeWork",
                "Where We Work",
                colorScheme: PageColorScheme.Dark,
                parentPitchItem: welcomeToCSGPro);
            var learnOurHistory = new PitchItem(
                "LearnOurHistory",
                "Learn Our History",
                parentPitchItem: welcomeToCSGPro);
            var portlandiaVideo = new PitchItem(
                "PortlandiaVideo",
                "Portlandia Video",
                colorScheme: PageColorScheme.Dark,
                parentPitchItem: welcomeToCSGPro);
            this.AllItems.Add(meetTheTeam);
            this.AllItems.Add(whereWeWork);
            this.AllItems.Add(learnOurHistory);
            this.AllItems.Add(portlandiaVideo);

            var welcome = new PitchItem(
                "Welcome",
                "Welcome",
                "Welcome! We're glad you're here.",
                null,
                "We built you an app because we love the idea of putting Zappos.com on the Windows Store! What better way could we demonstrate our enthusiasm?\n\nThis application will guide you through the details of our overall approach and hopefully answer any questions you may have. We hope you enjoy the experience!",
                null,
                null,
                PageColorScheme.Light,
                HomeTileLayout.ExtraWideTextOnly,
                group1);
            group1.Items.Add(welcome);
            this.AllItems.Add(welcome);

            this.AllGroups.Add(group1);

            //More Information
            //	About Our Approach
            //		Project Management
            //		Testing
            //		Why C#/XAML?
            //	Connect
            //	Project Details
            //		Requirements
            //		Timeline
            //	Microsoft Application Acceleration Program (MAAP)

            var group2 = new PitchItemGroup(
                "MoreInformation",
                "More Information");

            var aboutCSGsApproach = new PitchItem(
                "AboutCSGsApproachLanding",
                "About CSG's Approach",
                "The gear we use. About CSG's approach.",
                null,
                null,
                "Assets/PhotoGear.jpg",
                null,
                PageColorScheme.Dark,
                HomeTileLayout.Standard,
                group2);
            group2.Items.Add(aboutCSGsApproach);
            this.AllItems.Add(aboutCSGsApproach);

            var whyCSharpXAML = new PitchItem(
                "WhyCSharpXAML",
                "Why C#/XAML?",
                parentPitchItem: aboutCSGsApproach);
            var projectManagement = new PitchItem(
                "ProjectManagement",
                "Project Management",
                parentPitchItem: aboutCSGsApproach);
            var testingMethods = new PitchItem(
                "TestingMethods",
                "Testing Methods",
                parentPitchItem: aboutCSGsApproach);
            this.AllItems.Add(projectManagement);
            this.AllItems.Add(testingMethods);
            this.AllItems.Add(whyCSharpXAML);

            var projectDetails = new PitchItem(
                "ProjectDetailsLanding",
                "Project Details",
                "Running resolutions. Check out the project details.",
                null,
                null,
                "Assets/PhotoRunning.jpg",
                null,
                PageColorScheme.Light,
                HomeTileLayout.Standard,
                group2);
            group2.Items.Add(projectDetails);
            this.AllItems.Add(projectDetails);

            var projectTimeline = new PitchItem(
                "ProjectTimeline",
                "Project Timeline",
                parentPitchItem: projectDetails);
            var technicalRequirements = new PitchItem(
                "TechnicalRequirements",
                "Technical Requirements",
                parentPitchItem: projectDetails);
            this.AllItems.Add(projectTimeline);
            this.AllItems.Add(technicalRequirements);

            var connect = new PitchItem(
                "ConnectLanding",
                "Connect",
                "We want to get to know you better. Connect with us!",
                null,
                null,
                "Assets/PhotoDude.jpg",
                null,
                PageColorScheme.Dark,
                HomeTileLayout.WideWithArrow,
                group2);
            group2.Items.Add(connect);
            this.AllItems.Add(connect);

            var maap = new PitchItem(
                "MicrosoftApplicationAccelerationProgram",
                "Microsoft Application Acceleration Program (MAAP)",
                "Learn about the Windows 8 Microsoft Application Acceleration Program (MAAP).",
                null,
                null,
                "Assets/PhotoChick2.jpg",
                null,
                PageColorScheme.Light,
                HomeTileLayout.WideWithArrow,
                group2);
            group2.Items.Add(maap);
            this.AllItems.Add(maap);

            this.AllGroups.Add(group2);
        }
        private void BuildBreadcrumbMenu(PitchItem currentItem)
        {
            if (currentItem != null)
            {
                // if null, get the button style and breadcrumb arrow image
                if (_buttonStyle == null)
                {
                    switch (currentItem.ColorScheme)
                    {
                        case Enums.PageColorScheme.Dark:
                            _buttonStyle = (Style)App.Current.Resources["BreadcrumbMenuStyleDark"];
                            break;
                        case Enums.PageColorScheme.Light:
                            _buttonStyle = (Style)App.Current.Resources["BreadcrumbMenuStyleLight"];
                            break;
                        default:
                            throw new Exception("Unexpected PageColorScheme enum value: " + currentItem.ColorScheme.ToString());
                    }
                }
                if (_breadcrumbArrow == null)
                {
                    switch (currentItem.ColorScheme)
                    {
                        case Enums.PageColorScheme.Dark:
                            _breadcrumbArrow = (BitmapImage)App.Current.Resources["BreadcrumbMenuArrowSmallDark"];
                            break;
                        case Enums.PageColorScheme.Light:
                            _breadcrumbArrow = (BitmapImage)App.Current.Resources["BreadcrumbMenuArrowSmallLight"];
                            break;
                        default:
                            throw new Exception("Unexpected PageColorScheme enum value: " + currentItem.ColorScheme.ToString());
                    }
                }

                var pitchItem = currentItem;
                var firstItem = true;
                while (pitchItem != null)
                {
                    var button = GetButton(pitchItem.PageTitle);
                    // if this is the first item in the list (from right to left)
                    // then hide the hit test
                    // otherwise wire up a click handler
                    if (firstItem)
                    {
                        button.IsHitTestVisible = false;
                    }
                    else
                    {
                        var pitchItemUniqueId = pitchItem.UniqueId;
                        button.Click += (clickSender, clickEventArgs) =>
                        {
                            NavigateToItemDetailPage(pitchItemUniqueId);
                        };
                    }
                    MenuItems.Children.Insert(0, button);

                    // add separator arrow
                    var arrowImage = new Image();
                    arrowImage.Source = _breadcrumbArrow;
                    arrowImage.Stretch = Stretch.None;
                    MenuItems.Children.Insert(0, arrowImage);

                    // if we have a parent pitch item, then update the pitch item reference
                    // otherwise we should have a reference to the top level group
                    // which we can use to the build the left most button
                    if (pitchItem.ParentPitchItem != null)
                    {
                        // set the pitch item to the parent pitch item
                        pitchItem = pitchItem.ParentPitchItem;
                    }
                    else
                    {
                        // make sure that the last pitch has a group reference
                        if (pitchItem.Group == null)
                            throw new Exception("Any pitch item that does not have a parent pitch item, should have a reference to a group.");

                        // setup the group button
                        var groupButton = GetButton("Home");
                        groupButton.Click += (clickSender, clickEventArgs) =>
                        {
                            NavigateToHomePage();
                        };
                        MenuItems.Children.Insert(0, groupButton);

                        // set the pitch item to null (to break out of the loop)
                        pitchItem = null;
                    }

                    // update the first item flag
                    firstItem = false;
                }
            }
            else
            {
                MenuItems.Children.Clear();
            }
        }
Ejemplo n.º 3
0
        public PitchItem(string uniqueId, string pageTitle, string title = null, string subtitle = null, string description = null, string imagePath = null,
			string content = null, PageColorScheme colorScheme = PageColorScheme.Light, HomeTileLayout layout = HomeTileLayout.Standard, 
			PitchItemGroup group = null, PitchItem parentPitchItem = null)
            : base(uniqueId, title, subtitle, description, imagePath)
        {
            this._pageTitle = pageTitle;
            this._content = content;
            this._colorScheme = colorScheme;
            this._layout = layout;
            this._group = group;
            this._parentPitchItem = parentPitchItem;
        }