Beispiel #1
0
 void LoadUsers()
 {
     foreach (var item in userService.GetAllUsers())
     {
         if (SelectedUser == null)
         {
             SelectedUser = item;
         }
         _users.Add(item);
     }
     stateManager.GoToState("Welcome");// go to this state.
 }
Beispiel #2
0
        public TestViewModel(IUsersService userService, IMediator mediator,
                             IVisualStateManager stateManager)
        {
            stateManager.GoToState("Initial");// go to this state.
            this.userService  = userService;
            this._mediator    = mediator;
            this.stateManager = stateManager;
            var syncContext = System.Threading.SynchronizationContext.Current;

            ThreadPool.QueueUserWorkItem(delegate
            {
                Thread.Sleep(3000);
                syncContext.Send(delegate
                {
                    LoadUsers();
                }, null);
            });
        }
Beispiel #3
0
        private void LoadUsers()
        {
            var allUsers = userService.GetAllUsers();

            if (allUsers == null)
            {
                return;
            }

            foreach (var item in allUsers)
            {
                if (SelectedUser == null)
                {
                    SelectedUser = item;
                }
                _users.Add(item);
            }
            stateManager.GoToState("Welcome");// go to this state.
        }
 private void InitData()
 {
     _contactsDataService.GetContacts(OnContactsArrived);
     _stateManager.GoToState("LoadingContacts");
 }