Beispiel #1
0
        private static NavigationItemViewModel createCategory(NavigationCategory category,
                                                              NavigationItemViewModel parent,
                                                              PersonalInformation personData)
        {
            string text = string.Empty;

            switch (category)
            {
            case NavigationCategory.PhysicalInformation:
                text = "身体測定";
                break;

            case NavigationCategory.ExamInformation:
                text = "試験結果";
                break;
            }

            return(new NavigationItemViewModel(new CategoryItem(text, category), parent, personData));
        }
		public CategoryItem(string itemText, NavigationCategory category) : base()
		{
			this.ItemText = new ReactivePropertySlim<string>(itemText);
			this.Category = new ReactivePropertySlim<NavigationCategory>(category);
		}
        /// <summary>
        /// Constructs the list of navigation items that are present within the navigation adapter.
        /// </summary>
        /// <returns>The navitation items.</returns>
        private List <NavigationItem> BuildNavigationItems()
        {
            var ret = new List <NavigationItem>();

            var main = new NavigationCategory()
            {
                id    = Resource.Id.main,
                title = GetString(Resource.String.main),
                items = new NavigationItem[] {
                    new NavigationIconItem()
                    {
                        id    = Resource.Id.workbench,
                        title = GetString(Resource.String.workbench),
                        icon  = Resource.Drawable.ic_nav_workbench,
                        //            hidden = activeFragment is WorkbenchFragment,
                        action = () => {
                            DisplayWorkbench();
                            HideDrawer();
                        },
                    },

                    new NavigationIconItem()
                    {
                        id    = Resource.Id.analyzer,
                        title = GetString(Resource.String.analyzer),
                        icon  = Resource.Drawable.ic_nav_analyzer,
//            hidden = activeFragment is AnalyzerFragment,
                        action = () => {
                            DisplayAnalyzer();
                            HideDrawer();
                        },
                    },

                    new NavigationIconItem()
                    {
                        id     = Resource.Id.grid,
                        title  = GetString(Resource.String.grid_device),
                        icon   = Resource.Drawable.ic_nav_devmanager,
                        action = () => {
                            DisplayGrid();
                            HideDrawer();
                        },
                    }
                },
            };

            var calculators = new NavigationCategory()
            {
                id    = Resource.Id.calculators,
                title = GetString(Resource.String.calculators),
                items = new NavigationItem[] {
                    new NavigationIconItem()
                    {
                        id     = Resource.Id.ptchart,
                        title  = GetString(Resource.String.ptchart),
                        icon   = Resource.Drawable.ic_nav_ptconversion,
                        action = () => {
                            StartActivity(typeof(PTChartActivity));
                        }
                    },

                    new NavigationIconItem()
                    {
                        id     = Resource.Id.shsc,
                        title  = GetString(Resource.String.shsc),
                        icon   = Resource.Drawable.ic_nav_supersub,
                        action = () => {
                            StartActivity(typeof(SuperheatSubcoolActivity));
                        }
                    },
                },
            };

            var reports = new NavigationCategory()
            {
                id    = Resource.Id.reports,
                title = GetString(Resource.String.reports),
                items = new NavigationItem[] {
                    new NavigationIconItem()
                    {
                        id     = Resource.Id.job,
                        title  = GetString(Resource.String.job_settings),
                        icon   = Resource.Drawable.ic_job,
                        action = () => {
                            StartActivity(typeof(JobActivity));
                        }
                    },
                    new NavigationIconItem()
                    {
                        id     = Resource.Id.report_data_logging,
                        title  = GetString(Resource.String.reporting),
                        icon   = Resource.Drawable.ic_nav_reporting,
                        action = () => {
                            StartActivity(typeof(ReportActivity));
                        }
                    },
                    new NavigationIconItem()
                    {
                        id     = Resource.Id.report_screenshot_archive,
                        title  = GetString(Resource.String.report_screenshot_archive),
                        icon   = Android.Resource.Drawable.IcMenuCamera,
                        action = () => {
                            StartActivity(typeof(ScreenshotArchiveActivity));
                        }
                    },
                    new NavigationIconItem()
                    {
                        id     = Resource.Id.report_certificates,
                        title  = GetString(Resource.String.report_certificates),
                        icon   = Resource.Drawable.ic_scroll,
                        action = () => {
                            StartActivity(typeof(CalibrationCertificateArchiveActivity));
                        }
                    },
                },
            };

            var cloud = new NavigationCategory()
            {
                title = GetString(Resource.String.cloud),
                items = new NavigationItem[] {
                    new NavigationIconItem()
                    {
                        id     = Resource.Id.cloud,
                        title  = GetString(Resource.String.portal),
                        icon   = Resource.Drawable.ic_cloud,
                        action = () => {
                            StartActivity(typeof(PortalActivity));
                        }
                    },
                },
            };

            var settings = new NavigationCategory()
            {
                title = GetString(Resource.String.settings),
                items = new NavigationItem[] {
                    new NavigationIconItem()
                    {
                        id     = Resource.Id.settings,
                        title  = GetString(Resource.String.settings),
                        icon   = Resource.Drawable.ic_settings,
                        action = () => {
                            StartActivity(typeof(AppPreferenceActivity));
                        }
                    },
                    new NavigationIconItem()
                    {
                        id     = Resource.Id.help,
                        title  = GetString(Resource.String.help),
                        icon   = Resource.Drawable.ic_help,
                        action = () => {
                            StartActivity(typeof(HelpPreferenceActivity));
                        }
                    }
                },
            };

            var exit = new NavigationCategory()
            {
                title = GetString(Resource.String.exit),
                items = new NavigationItem[] {
                    new NavigationIconItem()
                    {
                        id     = Resource.Id.exit,
                        title  = GetString(Resource.String.exit_ion),
                        icon   = Resource.Drawable.ic_nav_power,
                        action = () => {
                            RequestShutdown();
                        }
                    },
                },
            };

            ret.Add(main);
            ret.Add(calculators);
            ret.Add(reports);
            ret.Add(cloud);
            ret.Add(settings);
            ret.Add(exit);

            return(ret);
        }