public MatchViewModel(NavigationService navigationService, IRestApiService apiService) { _navigationService = navigationService ?? throw new NullReferenceException();; _apiService = apiService ?? throw new NullReferenceException(); var cont = App.Container.Resolve <ApplicationDataContainer>(); var valid = this.WhenAnyValue(x => x.Error404, (q) => q == true); LikeCommand = ReactiveCommand.CreateFromTask(async() => { try { await _apiService.Liked(_id, cont.Values["AuthToken"] as string); await GetNewPersone(); } catch (Exception e) { await new MessageDialog(e.Message).ShowAsync(); } }); PassCommand = ReactiveCommand.CreateFromTask(async() => { try { await _apiService.Liked(_id, cont.Values["AuthToken"] as string); await GetNewPersone(); } catch (Exception e) { await new MessageDialog(e.Message).ShowAsync(); } }); SaveSettingCommand = ReactiveCommand.CreateFromTask(async() => { try { await _apiService.SetSearchParameters(new SearchParameterDto { }, cont.Values["AuthToken"] as string); await GetNewPersone(); } catch (Exception e) { await new MessageDialog(e.Message).ShowAsync(); } }); LocationCommand = ReactiveCommand.CreateFromTask(async() => { try { var loc = App.Container.Resolve <LocationService>(); await loc.GetAccess(); } catch (Exception) { } }); }