Procházet zdrojové kódy

Fixed LocalizedString not updating if only parameters changed

CPKreuz před 1 rokem
rodič
revize
b0dba62065

+ 3 - 1
src/PixiEditor.Extensions/UI/Translator.cs

@@ -117,7 +117,9 @@ public class Translator : UIElement
 
     private static void LocalizedStringPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)
     {
-        d.SetValue(KeyProperty, ((LocalizedString)e.NewValue).Key);
+        var key = ((LocalizedString)e.NewValue).Key;
+        d.SetValue(KeyProperty, key);
+        UpdateKey(d, key);
     }
 
     private static void EnumPropertyChangedCallback(DependencyObject d, DependencyPropertyChangedEventArgs e)

+ 1 - 1
src/PixiEditor/Views/UserControls/AutosaveControl.xaml

@@ -66,7 +66,7 @@
                     </TextBlock.Style>
                 </TextBlock>
                 <Label
-                    ui:Translator.LocalizedString="{Binding MainMenuText, FallbackValue='', Mode=OneWay}"
+                    ui:Translator.LocalizedString="{Binding MainMenuText, Mode=OneWay}"
                     Foreground="White" />
             </StackPanel>
             <StackPanel Grid.Column="1" Orientation="Horizontal">