private void RaiseSeoLocalesFilter(string locale) { //detach property changed if (CurrentSeoKeyword != null) { CurrentSeoKeyword.PropertyChanged -= CurrentSeoKeyword_PropertyChanged; } CurrentSeoKeyword = SeoKeywords.FirstOrDefault(keyword => keyword.Language.Equals(locale, StringComparison.InvariantCultureIgnoreCase) && keyword.IsActive); if (CurrentSeoKeyword == null) { CurrentSeoKeyword = CreateSeoUrlKeyword(locale); SeoKeywords.Add(CurrentSeoKeyword); } //attach property changed CurrentSeoKeyword.PropertyChanged += CurrentSeoKeyword_PropertyChanged; FilterSeoLanguage = locale; }
private void RaiseSeoLocalesFilter(string locale) { //detach property changed if (CurrentSeoKeyword != null) { CurrentSeoKeyword.PropertyChanged -= CurrentSeoKeyword_PropertyChanged; } CurrentSeoKeyword = SeoKeywords.FirstOrDefault(keyword => keyword.Language.Equals(locale, StringComparison.InvariantCultureIgnoreCase) && keyword.IsActive); if (CurrentSeoKeyword == null) { CurrentSeoKeyword = new SeoUrlKeyword { Language = locale, IsActive = true, KeywordType = (int)SeoUrlKeywordTypes.Item, KeywordValue = InnerItem.Code, Created = DateTime.UtcNow }; SeoKeywords.Add(CurrentSeoKeyword); } FilterSeoLanguage = locale; //attach property changed CurrentSeoKeyword.PropertyChanged += CurrentSeoKeyword_PropertyChanged; }