Example #1
0
 public RoomStateViewModel(int roomId, IUiRoomService roomService)
 {
     _roomId      = roomId;
     _roomService = roomService;
     _poller      = new Timer(PollUserStates);
     UserStates   = new ObservableDictionary <long, UserStateInfoViewModel>();
     _context     = SynchronizationContext.Current;
 }
Example #2
0
        public RoomNavigationViewModel(IUiRoomService roomService, IUiGlobalRoomsService globalRoomsService)
        {
            _roomService        = roomService;
            _globalRoomsService = globalRoomsService;
            _searchResults      = new RoomInfoViewModel[0];

            _globalRoomsService.SearchCompleted += HandleSearchCompleted;
        }
Example #3
0
        public RoomStateViewModel(IUiRoomService roomService, IUiAuthenticationService authenticationService)
        {
            _roomService           = roomService;
            _authenticationService = authenticationService;
            _poller    = new Timer(PollUserStates);
            UserStates = new ObservableCollection <UserStateInfoViewModel>();
            _context   = SynchronizationContext.Current;

            roomService.JoinRoomCompleted += HandleJoinRoomCompleted;
        }
Example #4
0
        public MainWindowViewModel(IUiAuthenticationService authenticationService,
                                   IUserStateListener userStateListener,
                                   IUiRoomService roomService,
                                   IUiGlobalRoomsService globalRoomsService)
        {
            _authenticationService   = authenticationService;
            _loginViewModel          = new LoginViewModel(authenticationService, userStateListener);
            _roomNavigationViewModel = new RoomNavigationViewModel(roomService, globalRoomsService);

            LoginVisibility         = Visibility.Visible;
            RoomNavigationVisiblity = Visibility.Collapsed;

            _authenticationService.LoginCompleted += HandleLoginCompleted;
        }
        public MainWindowViewModel(IUiAuthenticationService authenticationService,
                                   IUiRoomService roomService,
                                   IUiGlobalRoomsService globalRoomsService,
                                   IUserStateService userStateService, IUiUserMessageService uiUserMessageService)
        {
            _authenticationService   = authenticationService;
            _roomService             = roomService;
            _loginViewModel          = new LoginViewModel(authenticationService);
            _roomNavigationViewModel = new RoomNavigationViewModel(roomService, globalRoomsService);
            _roomStateViewModel      = new RoomStateViewModel(_roomService, authenticationService, uiUserMessageService);
            _startStopViewModel      = new StartStopViewModel(userStateService);

            ShowLogin();

            _authenticationService.LoginCompleted += HandleLoginCompleted;
        }
        public RoomNavigationViewModel(IUiRoomService roomService, IUiGlobalRoomsService globalRoomsService)
        {
            _roomService        = roomService;
            _globalRoomsService = globalRoomsService;
            _searchResults      = new RoomInfoViewModel[0];

            JoinRoomCommand = new DelegateCommand(_ =>
            {
                if (Selected == null)
                {
                    return;
                }
                Message = "joining room..";
                _roomService.JoinRoomAsync(Selected.RoomId);
            });

            _roomService.JoinRoomCompleted      += HandleJoinRoomCompleted;
            _globalRoomsService.SearchCompleted += HandleSearchCompleted;
        }