Example #1
0
        public ViewModelLocator()
        {
            _proxy = new ChatProxy();

            _authorization = new AuthorizationViewModel(_proxy);
            _chat = new ChatViewModel(_proxy);
            _log = new LogViewModel(_proxy);
        }
 public AuthorizationViewModel(ChatProxy proxy)
 {
     _user = new UserDTO();
     _proxy = proxy;
     _proxy.Connected += ProxyConnected;
     _proxy.Exception += ProxyException;
     AuthorizationCommand = new RelayCommand(Authorization);
 }
Example #3
0
 public LogViewModel(ChatProxy proxy)
 {
     CurrentState = new NormalFilterState(this);
     Messages = new ObservableCollection<MessageDTO>();
     _proxy = proxy;
     _proxy.GetUsers += ProxyGetUsers;
     _proxy.GetLog += ProxyGetLog;
     GetLogCommand = new RelayCommand(ActionGetLog);
     GetUsersCommand = new RelayCommand(GetUsers);
 }
Example #4
0
        public ChatViewModel(ChatProxy proxy)
        {
            _proxy = proxy;
            _proxy.RefreshUsers += ProxyRefreshUsers;
            _proxy.ReceiveMessage += ProxyRecieveMessage;
            _proxy.ReturnedUser += ProxyReturnedUser;

            LogShowCommand = new RelayCommand(LogShow);
            SendMessageCommand = new RelayCommand(SendMessage);
            ClosedCommand = new RelayCommand(ClosedWindow);

            Users=new ObservableCollection<UserDTO>();
            Messages = new ObservableCollection<MessageDTO>();
        }