/// <summary>
        ///     Initializes a new instance of the ViewModelLocator class.
        /// </summary>
        public ViewModelLocator()
        {
            ServiceLocator.SetLocatorProvider(() => SimpleIoc.Default);

            ////if (ViewModelBase.IsInDesignModeStatic)
            ////{
            ////    // Create design time view services and models
            ////    SimpleIoc.Default.Register<IDataService, DesignDataService>();
            ////}
            ////else
            ////{
            ////    // Create run time view services and models
            ////    SimpleIoc.Default.Register<IDataService, DataService>();
            ////}

            SimpleIoc.Default.Register <MainViewModel>();
            SimpleIoc.Default.Register <MessageViewModel>();
            SimpleIoc.Default.Register <AutoControllerViewModel>();
            SimpleIoc.Default.Register <MaterialAutoWarehouseController>();
            SimpleIoc.Default.Register <PreProductAutoWarehouseController>();
            SimpleIoc.Default.Register <ProductAutoWarehouseController>();
            SimpleIoc.Default.Register <ConverterViewModel>();

            var setting = new SettingViewModel();

            setting = SearchTerminalSetting(setting);
            SimpleIoc.Default.Register(() => setting);
        }
        /// <summary>
        /// Search terminal setting from configuration file.
        /// </summary>
        /// <param name="setting"></param>
        /// <returns></returns>
        private SettingViewModel SearchTerminalSetting(SettingViewModel setting)
        {
#if !FORGING_TERMINALS
            // Find terminal setting file path from application configuration manager.
            var terminalSettingRelativeUrl = ConfigurationManager.AppSettings["TerminalsConfigurationFile"];
            if (string.IsNullOrEmpty(terminalSettingRelativeUrl))
            {
                return(setting);
            }

            setting.LoadTerminalSettingsFromFile(terminalSettingRelativeUrl);
#else
            setting.LoadTerminalSettingsFromFile("");
#endif
            return(setting);
        }