예제 #1
0
        public UserControlMenuItem(ItemMenu itemMenu)
        {
            InitializeComponent();

            head = itemMenu.Header;

            ExpanderMenu.Visibility     = itemMenu.SubItems == null ? Visibility.Collapsed : Visibility.Visible;
            ListViewItemMenu.Visibility = itemMenu.SubItems == null ? Visibility.Visible : Visibility.Collapsed;

            this.DataContext = itemMenu;
        }
예제 #2
0
        //Initialize slide out menu and content
        public void createSlideProj()
        {
            Menu.Children.RemoveRange(1, Menu.Children.Count - 1);

            List <Project> SlideOutList = PPMT.BubbleGraphUserControl.BubbleGraph.JSONList;

            int length = SlideOutList.Count;

            for (int i = 0; i < length; i++)
            {
                var projMenu = new List <SubItem>();

                projMenu.Add(new SubItem(SlideOutList[i]));

                var newProj = new ItemMenu(SlideOutList[i].pName, projMenu, i);

                Menu.Children.Add(new UserControlMenuItem(newProj));
            }
        }
예제 #3
0
        private void nextButtonClicked(object sender, RoutedEventArgs e)
        {
            resource       = (double)one.Content;
            data           = (double)two.Content;
            vendors        = (double)three.Content;
            sponsorship    = (double)four.Content;
            implementation = (double)five.Content;

            App.Current.Properties["resource"]       = resource;
            App.Current.Properties["data"]           = data;
            App.Current.Properties["vendors"]        = vendors;
            App.Current.Properties["sponsorship"]    = sponsorship;
            App.Current.Properties["implementation"] = implementation;

            Project newProj = new Project()
            {
                pName      = ((string)App.Current.Properties["projectName"]),
                pSponsor   = ((string)App.Current.Properties["projectSponsor"]),
                rDate      = ((string)App.Current.Properties["requestDate"]),
                pDeadline  = ((string)App.Current.Properties["deadlineDate"]),
                pSavings   = ((ulong)App.Current.Properties["savings"]),
                value      = ((double)App.Current.Properties["value"]),
                strategicA = ((double)App.Current.Properties["strategicA"]),
                //hrpriority = ((double)App.Current.Properties["hrpriority"]),
                risk            = ((double)App.Current.Properties["risk"]),
                resource        = ((double)App.Current.Properties["resource"]),
                data            = ((double)App.Current.Properties["data"]),
                vendors         = ((double)App.Current.Properties["vendors"]),
                sponsorship     = ((double)App.Current.Properties["sponsorship"]),
                implementation  = ((double)App.Current.Properties["implementation"]),
                projectCategory = ((string)App.Current.Properties["projectC"])
            };

            string docPath = Directory.GetCurrentDirectory();

            PPMT.BubbleGraphUserControl.BubbleGraph.JSONList.Add(newProj);

            string convertedJson = JsonConvert.SerializeObject(PPMT.BubbleGraphUserControl.BubbleGraph.JSONList, Formatting.Indented);

            File.WriteAllText((System.IO.Path.Combine(docPath, "projects.json")), convertedJson);

            PPMT.BubbleGraphUserControl.BubbleGraph.AddNewProject(newProj);

            var categoryToggled = true;

            switch (newProj.projectCategory)
            {
            case "Transformative Growth":

                categoryToggled = PPMT.BubbleGraphUserControl.BubbleGraph.tGN.IsChecked ?? true;

                PPMT.BubbleGraphUserControl.BubbleGraph.categoriesToggle(categoryToggled, newProj.projectCategory);

                break;

            case "Quality of Talent":

                categoryToggled = PPMT.BubbleGraphUserControl.BubbleGraph.qOTN.IsChecked ?? true;

                PPMT.BubbleGraphUserControl.BubbleGraph.categoriesToggle(categoryToggled, newProj.projectCategory);

                break;

            case "Measurement and KPI":

                categoryToggled = PPMT.BubbleGraphUserControl.BubbleGraph.mAKN.IsChecked ?? true;

                PPMT.BubbleGraphUserControl.BubbleGraph.categoriesToggle(categoryToggled, newProj.projectCategory);

                break;

            case "ONA":

                categoryToggled = PPMT.BubbleGraphUserControl.BubbleGraph.oNAN.IsChecked ?? true;

                PPMT.BubbleGraphUserControl.BubbleGraph.categoriesToggle(categoryToggled, newProj.projectCategory);

                break;

            case "Consolidation/Cost":

                categoryToggled = PPMT.BubbleGraphUserControl.BubbleGraph.cCN.IsChecked ?? true;

                PPMT.BubbleGraphUserControl.BubbleGraph.categoriesToggle(categoryToggled, newProj.projectCategory);

                break;

            case "Other":

                categoryToggled = PPMT.BubbleGraphUserControl.BubbleGraph.otherN.IsChecked ?? true;

                PPMT.BubbleGraphUserControl.BubbleGraph.categoriesToggle(categoryToggled, newProj.projectCategory);

                break;

            default:

                break;
            }

            var projMenu = new List <SubItem>();

            projMenu.Add(new SubItem(newProj));

            var proj1 = new ItemMenu(newProj.pName, projMenu, PPMT.MainWindow.mainAccess.Menu.Children.Count - 1);

            PPMT.MainWindow.mainAccess.Menu.Children.Add(new UserControlMenuItem(proj1));

            PPMT.NewProj.projectWindow.Close();
        }