/// <summary>
        /// Initializes a new instance of the LocalisationHelper class.
        /// </summary>
        public LocalizationHelper()
        {
#if SILVERLIGHT
            _isInDesignMode = DesignerProperties.IsInDesignTool;
#else
            var prop = DesignerProperties.IsInDesignModeProperty;
            _isInDesignMode
                = (bool)DependencyPropertyDescriptor
                  .FromProperty(prop, typeof(FrameworkElement))
                  .Metadata.DefaultValue;

            // Just to be sure
            if (!_isInDesignMode &&
                Process.GetCurrentProcess().ProcessName.StartsWith("devenv", StringComparison.Ordinal))
            {
                _isInDesignMode = true;
            }
#endif

            if (!_isInDesignMode)
            {
                // Get the services we need from the service locator
                // We can't use ctor injection as we are XAML created
                _resourceManager = ServiceLocator.Current.GetInstance <IResourceManagerService>();
                _eventAggregator = ServiceLocator.Current.GetInstance <IEventAggregator>();

                // Refresh all the bindings when the locale changes
                _eventAggregator.GetEvent <LocaleChangedEvent>().Subscribe(OnLocaleChange);
            }
        }
        /// <summary>
        /// Initializes a new instance of the LocalisationHelper class.
        /// </summary>
        public LocalizationHelper()
        {
#if SILVERLIGHT
             _isInDesignMode = DesignerProperties.IsInDesignTool;
#else
            var prop = DesignerProperties.IsInDesignModeProperty;
            _isInDesignMode
                = (bool)DependencyPropertyDescriptor
                             .FromProperty(prop, typeof(FrameworkElement))
                             .Metadata.DefaultValue;

            // Just to be sure
            if (!_isInDesignMode
                && Process.GetCurrentProcess().ProcessName.StartsWith("devenv", StringComparison.Ordinal))
            {
                _isInDesignMode = true;
            }
#endif

            if (!_isInDesignMode)
            {
                // Get the services we need from the service locator
                // We can't use ctor injection as we are XAML created
                _resourceManager = ServiceLocator.Current.GetInstance<IResourceManagerService>();
                _eventAggregator = ServiceLocator.Current.GetInstance<IEventAggregator>();

                // Refresh all the bindings when the locale changes
                _eventAggregator.GetEvent<LocaleChangedEvent>().Subscribe(OnLocaleChange);
            }
        }
Esempio n. 3
0
 public EmployeeListViewModel(IEmployeeService employeeService, IMapperWrapper mapperWrapper, IDepartmentService departmentService, IResourceManagerService resourceManagerService)
 {
     _employeeService        = employeeService;
     _mapperWrapper          = mapperWrapper;
     _departmentService      = departmentService;
     _resourceManagerService = resourceManagerService;
     CreateEmployeeCommand   = new DelegateCommandAsync(ExecuteCreateEmployee);
 }
Esempio n. 4
0
 public void SetUp()
 {
     _employeeService        = A.Fake <IEmployeeService>();
     _departmentService      = A.Fake <IDepartmentService>();
     _mapperWrapper          = A.Fake <IMapperWrapper>();
     _resourceManagerService = A.Fake <IResourceManagerService>();
     _employeeListViewModel  = new EmployeeListViewModel(_employeeService, _mapperWrapper, _departmentService, _resourceManagerService);
     Init();
 }
Esempio n. 5
0
 public AzureManagementService(IAeroLogger <AzureManagementService> logger, IResourceManagerService resourceManagerService, IWebsiteService websiteService) : base(logger)
 {
     ResourceManager = resourceManagerService;
     Website         = websiteService;
 }