Open Kirlu opened 6 years ago
I could kind of remove the bug, but changing language would then not be supported. But I agree this should not crash. This library is not supposed to get in your way.
In the concrete example, one might want to use two buttons instead though, and the collapse one of them depending on the state.
This could also be solved from the view-model quite easily.
public string ButtonText => CanOpen ? _("Open") : _("Close");
PropertyChanged += (s, e) => {
if (e.PropertyName == "CanOpen")
{
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("ButtonText");
}
};
When adding a translation to a style where the translation changes based on fx. DataTriggers this throws an Exception.
System.Windows.Markup.XamlParseException: ''Provide value on 'NGettext.Wpf.GettextExtension' threw an exception.' Line number '61' and line position '48'.' Inner Exception: InvalidCastException: Unable to cast object of type 'System.Windows.Setter' to type 'System.Windows.DependencyObject'.