Ejemplo n.º 1
0
        private void PivotMenu_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.IsInDesignTool)
            {
                // Some design-time data
                var processMenu = new ProcessAreaItem();
                processMenu.Title = "Process Area 1";

                for (int index = 1; index < 6; index++)
                {
                    var activityItem = new ActivityItem();
                    activityItem.Title = "Activity " + index.ToString();
                    processMenu.Add(activityItem);
                }

                MenuCollection menuCollection = new MenuCollection();
                menuCollection.Add(processMenu);

                processMenu       = new ProcessAreaItem();
                processMenu.Title = "Process Area 2";

                for (int index = 1; index < 6; index++)
                {
                    var activityItem = new ActivityItem();
                    activityItem.Title = "Activity " + index.ToString();
                    processMenu.Add(activityItem);
                }

                menuCollection.Add(processMenu);

                this.ItemsSource = menuCollection;
            }
            else
            {
                MenuCollection menu = ApplicationEx.Instance.ApplicationMenu;

                if (ShouldMakeSingleLevelMenu(menu))
                {
                    menu = MakeSingleLevelMenu(menu);
                }

                this.ItemsSource = menu;
            }
        }
Ejemplo n.º 2
0
        private void PivotMenu_Loaded(object sender, RoutedEventArgs e)
        {
            if (DesignerProperties.IsInDesignTool)
            {
                // Some design-time data
                var processMenu = new ProcessAreaItem();
                processMenu.Title = "Process Area 1";

                for (int index = 1; index < 6; index++)
                {
                    var activityItem = new ActivityItem();
                    activityItem.Title = "Activity " + index.ToString();
                    processMenu.Add(activityItem);
                }

                MenuCollection menuCollection = new MenuCollection();
                menuCollection.Add(processMenu);

                processMenu = new ProcessAreaItem();
                processMenu.Title = "Process Area 2";

                for (int index = 1; index < 6; index++)
                {
                    var activityItem = new ActivityItem();
                    activityItem.Title = "Activity " + index.ToString();
                    processMenu.Add(activityItem);
                }

                menuCollection.Add(processMenu);

                this.ItemsSource = menuCollection;
            }
            else
            {
                MenuCollection menu = ApplicationEx.Instance.ApplicationMenu;

                if (ShouldMakeSingleLevelMenu(menu))
                    menu = MakeSingleLevelMenu(menu);

                this.ItemsSource = menu;
            }
        }