Skip to content

Dynamically setting the ForceCulture attribute #357

Answered by Karnah
belugabob asked this question in Q&A
Discussion options

You must be logged in to vote

Hello, @belugabob!
Unfortunately, it's really very hard to replace ForceCulture from string to Binding. I'll have some ideas how to make it's more possible.

But I have one idea how you can deal with it. You can write converter like this:

public class CultureNameConverter : TypeValueConverterBase, IValueConverter
{
    /// <inheritdoc />
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        var valueCulture = value as CultureInfo;
        if (valueCulture == null)
            return string.Empty;

        var key = parameter as string;
        if (string.IsNullOrEmpty(key))
            return string.Empty;

        return Ressourcen.R…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@belugabob
Comment options

Answer selected by belugabob
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants