public async void OnNavigatedTo(NavigationEventArgs e) { var activeUser = e.Parameter as User; if (First) { ConnectedUser = activeUser; await _hubService.ConnectToHub(ConnectedUser); await _messageService.Show("Wellcome, " + ConnectedUser.Name); _hubService.RegisterAction("JoinToChat", async(object chat) => await JoinToChat(chat as Chat)); _hubService.RegisterAction("JoinToGame", async(object board) => await JoinToGame(board as Board)); _hubService.RegisterAction("LogInNotification", async(object user) => await AddOnlineUser(user as User)); _hubService.RegisterAction("CatchCancelation", async(object empty) => await CatchCancelation()); _hubService.RegisterAction("CatchChatConnection", async(object userName) => await CatchChatConnection(userName as string)); _hubService.RegisterAction("CatchGameConnection", async(object userName) => await CatchGameConnection(userName as string)); await GetOnlineUsers(); First = false; } }