public AdminViewModel() { _container = new UnityContainer(); _container.RegisterType <IUserService, UserService>(); _container.RegisterType <IClientService, ClientService>(); _container.RegisterType <IClientMessageService, ClientMessageService>(); _container.RegisterType <IDispatcherMessageService, DispatcherMessageService>(); _modelUserService = new ModelUserService(_container); _modelClientService = new ModelClientService(_container); _modelClientMessageService = new ModelClientMessageService(_container); _modelDespatcherMessageService = new ModelDespatcherMessageService(_container); _messages = new ObservableCollection <MessageAll>(); _users = _modelUserService.GetUsers(); _clients = _modelClientService.GetClients(); _clentMessages = _modelClientMessageService.GetClientMessage(); _dispatcherMessages = _modelDespatcherMessageService.GetDispatcharMessage(); _fromDate = new DateTime(2019, 05, 01); _toDate = DateTime.Now; _checkLoginText = "Enter Login!"; OkCommandLinq = new RelayCommand(OnCommandLinq); SaveCommand = new RelayCommand(OnSaveCommand, CanOnSaveExecute); }
public DispatcherControlModel() { _botLogic = new LogicBot(); _container = new UnityContainer(); _container.RegisterType <IClientMessageService, ClientMessageService>(); _container.RegisterType <IClientService, ClientService>(); _container.RegisterType <IDispatcherMessageService, DispatcherMessageService>(); _container.RegisterType <IWorkTimeDispatcherService, WorkTimeDispatcherService>(); _container.RegisterType <IUserService, UserService>(); _modelClientMessageService = new ModelClientMessageService(_container); _modelClientService = new ModelClientService(_container); _modelDespatcherMessageService = new ModelDespatcherMessageService(_container); _modelUserService = new ModelUserService(_container); _clients = _modelClientService.GetClients(); _users = _modelUserService.GetUsers(); _clientsChat = new ObservableCollection <ClientInfo>(); Messages = new ObservableCollection <DisBotMessage>(); _user = new UserModel(); _mainListBox = new ListBox(); _сhoiceClient = new ClientInfo(); _isConnect = true; Context = SynchronizationContext.Current; SendMessageCommand = new RelayCommand(OnSendMessageCommandExecute); ConnectCommand = new RelayCommand(OnConnectCommand); DisconnectCommand = new RelayCommand(OnDisconnectCommand); _botLogic.LogStart += BotLogicLogStart; UserName = ((MainWindow)Application.Current.MainWindow).tbLogin.Text; EventClosedWindow(); InitUser(); }
public MainWindowViewModel() { _container = new UnityContainer(); _container.RegisterType <IUserService, UserService>(); _container.RegisterType <IWorkTimeDispatcherService, WorkTimeDispatcherService>(); _modelUserService = new ModelUserService(_container); _modelWorkTimeDispatcherService = new ModelWorkTimeDispatcherService(_container); Users = _modelUserService.GetUsers(); _workTimeDis = new WorkTimeDispatcherInfo(); ShowDialogCommand = new ShowDialogCommand(PostOpenDialog, PreOpenDialog); OpenWindowCommand = new OpenWindowCommand(); EnterLogin = new RelayCommand(OnEnterLogin); }