public profileViewModel(IUserData userdata, IEventAggregator events, ISocketHandler socketHandler) { _userData = userdata; _events = events; _events.Subscribe(this); _socketHandler = socketHandler; this.statsClient = JsonConvert.DeserializeObject <StatsClient>(this._socketHandler.TestGETWebRequest("/profile/stats/" + this._userData.userName).ToString()); _avatars = new BindableCollection <Avatar>(); fillAvatars(); nbAvatars = _avatars.Count(); _selectedAvatarIndex = 0; _initialPP = JsonConvert.DeserializeObject <PrivateProfile>(socketHandler.TestGETWebRequest("/profile/private/" + userdata.userName).ToString()); _newlPP = new PrivateProfile(_initialPP.firstname, _initialPP.firstname, _initialPP.lastname, _initialPP.password, _initialPP.avatar); }