예제 #1
0
        public TestConnectionViewModel(IPluginRepository pluginRepository)
        {
            _pluginRepository = pluginRepository;

            StatusIndicator = new StatusIndicatorViewModel();
            Notifications   = new NotificationCenterViewModel {
                ShowEmptyMessage = false, ShowTimeStamp = false
            };
            TestConnectionCommand = AsyncCommand.Create(TestConnection);
        }
예제 #2
0
        public ShellViewModel()
        {
            _regionManager     = ServiceLocator.Current.GetInstance <IRegionManager>();
            _navigationManager = ServiceLocator.Current.GetInstance <NavigationManager>();
            CommandInit();
            OnUIThread(() => OnPropertyChanged("IsMainMenuVisible"));
            RiseWindowResizeCommand();
            var container = ServiceLocator.Current.GetInstance <IUnityContainer>();

            container.RegisterType <IGlobalConfigService, GlobalConfigService>(new ContainerControlledLifetimeManager());
            // subscribe to custommers service messages
            EventSystem.Subscribe <ShellMessageEvent>((mess) => OnUIThread(() =>
            {
                NumAssignedCases = mess.Message == "0" ? "" : mess.Message;
            }));
            // subscribe to GUI languages messages
            EventSystem.Subscribe <GenericEvent <Tuple <List <CultureInfo>, Action <string> > > >(xx => OnUIThread(() =>
            {
                AvailableGuiCultures.Clear();

                xx.Message.Item1.ForEach(x =>
                {
                    AvailableGuiCultures.Add(x);
                });
                if (AvailableGuiCultures.All(x => x.Name != "en-US"))
                {
                    AvailableGuiCultures.Insert(0, CultureInfo.GetCultureInfo("en-US"));
                }

                if (AvailableGuiCultures.All(x => x.Name != System.Threading.Thread.CurrentThread.CurrentUICulture.Name))
                {
                    CultureInfo.DefaultThreadCurrentUICulture = CultureInfo.GetCultureInfo("en-US");
                }
                GuiCulture           = System.Threading.Thread.CurrentThread.CurrentUICulture.ThreeLetterWindowsLanguageName;
                ChangeLanguageAction = xx.Message.Item2;

                // perform other initialization as Localization module has initialized.
                if (StatusIndicatorVM == null)
                {
                    StatusIndicatorVM = StatusIndicatorViewModel.GetInstance();
                }
            }));
        }
예제 #3
0
        public StatusIndicator()
        {
            DataContext = StatusIndicatorViewModel.GetInstance();

            InitializeComponent();
        }