Example #1
0
        private void OnCoordLangStatusChanged(SelectableLanguage selectableLanguage)
        {
            if (_selectedUser is null)
            {
                return;
            }


            if (selectableLanguage.Selected)
            {
                if (_selectedUser.CoordinatingLanguages.Contains((int)selectableLanguage.Id))
                {
                    return;
                }
                _selectedUser.CoordinatingLanguages.Add((int)selectableLanguage.Id);
            }
            else
            {
                if (_selectedUser.CoordinatingLanguages.Contains((int)selectableLanguage.Id))
                {
                    _selectedUser.CoordinatingLanguages.Remove((int)selectableLanguage.Id);
                }
            }

            StateHasChanged();
        }
Example #2
0
        public MainViewModel(ForecastRepository forecastRepository, IMapper mapper, ILogger logger) : this()
        {
            this.forecastRepository = forecastRepository ?? throw new ArgumentNullException(nameof(forecastRepository));
            this.mapper             = mapper ?? throw new ArgumentNullException(nameof(mapper));
            this.logger             = logger ?? throw new ArgumentNullException(nameof(logger));

            //Ezek csak az éles felhasználáshoz kellenek, ezért a default konstruktorba nem kellenek
            //todo: ezt elmenteni beállíthatónak
            SelectedCity = SelectableCity.Single(x => x.Coordinates == "47.49801,19.03991");
            var code = Settings.Default.Culture.LanguageNameToCode();

            SelectedLanguage = SelectableLanguage.Single(x => x.Code == code);
        }