public void OnCultureChanged(object sender, CultureChangedEventArgs args) { name = LocalizationManager.Instance.GetValue($"NPCName.{Key}"); OnPropertyChanged(nameof(Name)); var c = GetNPCCategory(); var values = Enum.GetValues <NPCCategory>() .Where(t => t != NPCCategory.Others && c.HasFlag(t)) .Select(t => LocalizationManager.Instance.GetValue($"UI.NPCCategories.{t}")); category = string.Join(", ", values); if (!category.Any()) { category = LocalizationManager.Instance.GetValue("UI.NPCCategories.Others"); } OnPropertyChanged(nameof(Category)); }
public void OnCultureChanged(object sender, CultureChangedEventArgs args) { name = LocalizationManager.Instance.GetValue($"ItemName.{Key}"); OnPropertyChanged(nameof(Name)); var c = GetItemCategory(); var values = Enum.GetValues <ItemCategory>() .Where(t => t != ItemCategory.Others && c.HasFlag(t)) .Select(t => LocalizationManager.Instance.GetValue($"UI.ItemCategories.{t}")); category = string.Join(", ", values); if (!category.Any()) { category = LocalizationManager.Instance.GetValue("UI.ItemCategories.Others"); } OnPropertyChanged(nameof(Category)); string key = $"ItemTooltip.{Key}"; tooltip = LocalizationManager.Instance.GetValue(key); if (tooltip == key) { tooltip = string.Empty; } OnPropertyChanged(nameof(Tooltip)); }
protected override void OnCultureChanged(CultureChangedEventArgs args) { //refresh displayname when culture changes: SetDisplayName(); }
protected override void OnCultureChanged(CultureChangedEventArgs args) { SetDisplayName(); }
protected override void OnCultureChanged(CultureChangedEventArgs args) { //Refresh the DisplayName when language changes SetDisplayName(); }
protected override void OnCultureChanged(CultureChangedEventArgs args) { //refresh the next/finish button text: SetNextLabel(); }
// event handler for Loaded event private void OnCultureChanged(object sender, CultureChangedEventArgs args) { this.DeliverEvent(sender, args); }
protected override void OnCultureChanged(CultureChangedEventArgs args) { //set commands to null so they're rebuilt with new translations when culture changes: _commands = null; RaisePropertyChanged(() => Commands); }
protected override void OnCultureChanged(CultureChangedEventArgs args) { //refresh displayname when culture changes (derived classes have to implement DisplayName property and will pull it from LocalizationService): RaisePropertyChanged(() => DisplayName); }
/// <summary> /// Override this in derived viewmodels to raise propertychanged events for any localized properties that are databound /// </summary> protected virtual void OnCultureChanged(CultureChangedEventArgs args) { }
private void LocalizationServiceCultureChanged(object sender, CultureChangedEventArgs args) { OnCultureChanged(args); }
private void OnUICultureChanged(object sender, CultureChangedEventArgs e) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(nameof(DisplayName))); }