I want to force my custom extension to bind again when my language change:
[MarkupExtensionReturnType(typeof(string))]
public class TranalstionExtension : MarkupExtension
{
public override object ProvideValue(IServiceProvider serviceProvider)
{
return Translator.Translate(this.Translate);
}
public string Translate { get; set; }
}
in usage:
<Button Content="{t:Tranalstion Translate=plus}"/>
I’m changing the language on the same Window so now it should return into property different translation, how to force MarkupExtension to do this but not only for Content property but for all occurrence of my extension mechanism on window.
Your data source has to implement the INotifyPropertyChanged event.
TranslationData then has to take care of getting informed about a langauge change and fire the PropertyChanged event.