Browse Source

Changed DialogTitleBar.TitleText to TitleKey

CPKreuz 2 years ago
parent
commit
2d4678e369

+ 1 - 1
src/PixiEditor/Views/Dialogs/AboutPopup.xaml

@@ -30,7 +30,7 @@
         </b:Interaction.Behaviors>
 
         <local:DialogTitleBar DockPanel.Dock="Top"
-                             TitleText="{Binding ElementName=aboutPopup, Path=Title}" 
+                             TitleKey="{Binding ElementName=aboutPopup, Path=Title}" 
                              CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
         <StackPanel DataContext="{Binding ElementName=aboutPopup}" Orientation="Vertical" DockPanel.Dock="Bottom" Margin="10">
             <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Top">

+ 1 - 1
src/PixiEditor/Views/Dialogs/ConfirmationPopup.xaml

@@ -28,7 +28,7 @@
         </i:Interaction.Behaviors>
 
         <dial:DialogTitleBar DockPanel.Dock="Top"
-            TitleText="{Binding ElementName=popup, Path=Title}" CloseCommand="{Binding DataContext.CancelCommand, ElementName=popup}" />
+            TitleKey="{Binding ElementName=popup, Path=Title}" CloseCommand="{Binding DataContext.CancelCommand, ElementName=popup}" />
 
         <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center"
                     Margin="0,0,10,15">

+ 1 - 1
src/PixiEditor/Views/Dialogs/CrashReportDialog.xaml

@@ -29,7 +29,7 @@
             <RowDefinition Height="Auto"/>
             <RowDefinition/>
         </Grid.RowDefinitions>
-        <dial:DialogTitleBar TitleText="PixiEditor has crashed!" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
+        <dial:DialogTitleBar TitleKey="PixiEditor has crashed!" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
         <Grid Grid.Row="1" Margin="30,30,30,0" >
             <StackPanel>
                 <Grid Background="{StaticResource MainColor}">

+ 1 - 1
src/PixiEditor/Views/Dialogs/DebugDialogs/CommandDebugPopup.xaml

@@ -33,7 +33,7 @@
 
         <local:DialogTitleBar DockPanel.Dock="Top"
                               CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"
-                              TitleText="Command Debug" />
+                              TitleKey="Command Debug" />
 
         <Grid>
             <Grid.RowDefinitions>

+ 1 - 1
src/PixiEditor/Views/Dialogs/DebugDialogs/Localization/LocalizationDebugWindow.xaml

@@ -47,7 +47,7 @@
             <behaviours:ClearFocusOnClickBehavior />
         </b:Interaction.Behaviors>
 
-        <dialogs:DialogTitleBar TitleText="LOCALIZATION_DEBUG_WINDOW_TITLE"
+        <dialogs:DialogTitleBar TitleKey="LOCALIZATION_DEBUG_WINDOW_TITLE"
                                 CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
 
         <StackPanel Grid.Row="1" Margin="5">

+ 1 - 1
src/PixiEditor/Views/Dialogs/DialogTitleBar.xaml

@@ -16,7 +16,7 @@
         </Grid.ColumnDefinitions>
         <TextBlock 
             TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" 
-            views:Translator.Key="{Binding ElementName=uc, Path=TitleText}"
+            views:Translator.Key="{Binding ElementName=uc, Path=TitleKey}"
             Foreground="White" 
             FontSize="15" 
             Margin="5,0,0,0" 

+ 8 - 5
src/PixiEditor/Views/Dialogs/DialogTitleBar.xaml.cs

@@ -7,8 +7,8 @@ namespace PixiEditor.Views.Dialogs;
 
 internal partial class DialogTitleBar : UserControl
 {
-    public static readonly DependencyProperty TitleTextProperty =
-        DependencyProperty.Register(nameof(TitleText), typeof(string), typeof(DialogTitleBar), new PropertyMetadata(""));
+    public static readonly DependencyProperty TitleKeyProperty =
+        DependencyProperty.Register(nameof(TitleKey), typeof(string), typeof(DialogTitleBar), new PropertyMetadata(""));
 
     public static readonly DependencyProperty CloseCommandProperty =
         DependencyProperty.Register(nameof(CloseCommand), typeof(ICommand), typeof(DialogTitleBar), new PropertyMetadata(null));
@@ -19,10 +19,13 @@ internal partial class DialogTitleBar : UserControl
         set { SetValue(CloseCommandProperty, value); }
     }
 
-    public string TitleText
+    /// <summary>
+    /// The localization key of the window's title
+    /// </summary>
+    public string TitleKey
     {
-        get { return (string)GetValue(TitleTextProperty); }
-        set { SetValue(TitleTextProperty, value); }
+        get { return (string)GetValue(TitleKeyProperty); }
+        set { SetValue(TitleKeyProperty, value); }
     }
 
     public DialogTitleBar()

+ 1 - 1
src/PixiEditor/Views/Dialogs/ExportFilePopup.xaml

@@ -32,7 +32,7 @@
 
 
         <dial:DialogTitleBar DockPanel.Dock="Top"
-            TitleText="EXPORT_IMAGE" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
+            TitleKey="EXPORT_IMAGE" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
 
         <Button DockPanel.Dock="Bottom" HorizontalAlignment="Center" IsDefault="True"
                     Margin="15" Style="{StaticResource DarkRoundButton}" local:Translator.Key="EXPORT" Command="{Binding OkCommand}"

+ 1 - 1
src/PixiEditor/Views/Dialogs/ImportFilePopup.xaml

@@ -38,7 +38,7 @@
         </i:Interaction.Behaviors>
 
         <dial:DialogTitleBar DockPanel.Dock="Top"
-            TitleText="Import image" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
+            TitleKey="Import image" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
         <Button DockPanel.Dock="Bottom" Width="70" HorizontalAlignment="Center" IsDefault="True"
                     Margin="15" Style="{StaticResource DarkRoundButton}" Content="Import" Command="{Binding OkCommand}"
                     CommandParameter="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" />

+ 1 - 1
src/PixiEditor/Views/Dialogs/ImportShortcutTemplatePopup.xaml

@@ -33,7 +33,7 @@
             <RowDefinition Height="*"/>
         </Grid.RowDefinitions>
         <diag:DialogTitleBar DockPanel.Dock="Top"
-                             TitleText="IMPORT_FROM_TEMPLATE" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
+                             TitleKey="IMPORT_FROM_TEMPLATE" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
         <ItemsControl Grid.Row="1" ItemsSource="{Binding Templates, ElementName=window}"
                       Margin="10,10,10,5">
             <ItemsControl.ItemsPanel>

+ 1 - 1
src/PixiEditor/Views/Dialogs/NewFilePopup.xaml

@@ -39,7 +39,7 @@
         </i:Interaction.Behaviors>
 
         <dial:DialogTitleBar DockPanel.Dock="Top"
-            TitleText="CREATE_NEW_IMAGE" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
+            TitleKey="CREATE_NEW_IMAGE" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
 
         <Button DockPanel.Dock="Bottom" Margin="0,15,0,15" HorizontalAlignment="Center"
                 IsDefault="True" local:Translator.Key="CREATE" x:Name="createButton"

+ 1 - 1
src/PixiEditor/Views/Dialogs/NoticePopup.xaml

@@ -27,7 +27,7 @@
         </i:Interaction.Behaviors>
 
         <dial:DialogTitleBar DockPanel.Dock="Top"
-            TitleText="{Binding ElementName=popup, Path=Title}" CloseCommand="{Binding DataContext.CancelCommand, ElementName=popup}" />
+            TitleKey="{Binding ElementName=popup, Path=Title}" CloseCommand="{Binding DataContext.CancelCommand, ElementName=popup}" />
 
         <StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" HorizontalAlignment="Center" Margin="0,0,0,15">
             <Button Width="70" IsDefault="True" Click="OkButton_Close" Style="{StaticResource DarkRoundButton}" views:Translator.Key="CLOSE"/>

+ 1 - 1
src/PixiEditor/Views/Dialogs/OptionsPopup.xaml

@@ -26,7 +26,7 @@
             <RowDefinition Height="Auto"/>
         </Grid.RowDefinitions>
 
-        <local:DialogTitleBar TitleText="{Binding Title, ElementName=popup}" CloseCommand="{Binding CancelCommand, ElementName=popup}"/>
+        <local:DialogTitleBar TitleKey="{Binding Title, ElementName=popup}" CloseCommand="{Binding CancelCommand, ElementName=popup}"/>
 
         <ContentPresenter Content="{Binding PopupContent, ElementName=popup}"
                           Grid.Row="1" Margin="15"/>

+ 1 - 1
src/PixiEditor/Views/Dialogs/PalettesBrowser.xaml

@@ -41,7 +41,7 @@
             <RowDefinition Height="1*"/>
         </Grid.RowDefinitions>
 
-        <dialogs:DialogTitleBar TitleText="PALETTE_BROWSER" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
+        <dialogs:DialogTitleBar TitleKey="PALETTE_BROWSER" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
 
         <DockPanel Background="{StaticResource MainColor}" Grid.Row="1">
             <StackPanel HorizontalAlignment="Left" Margin="10" Orientation="Horizontal" VerticalAlignment="Center">

+ 1 - 1
src/PixiEditor/Views/Dialogs/ResizeCanvasPopup.xaml

@@ -34,7 +34,7 @@
         </i:Interaction.Behaviors>
 
         <dial:DialogTitleBar DockPanel.Dock="Top"
-            TitleText="RESIZE_CANVAS" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
+            TitleKey="RESIZE_CANVAS" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
 
         <Button DockPanel.Dock="Bottom" Padding="5 0" HorizontalAlignment="Center" Margin="15"
                 Style="{StaticResource DarkRoundButton}" local:Translator.Key="RESIZE" Click="Button_Click" IsDefault="True" />

+ 1 - 1
src/PixiEditor/Views/Dialogs/ResizeDocumentPopup.xaml

@@ -33,7 +33,7 @@
         </i:Interaction.Behaviors>
 
         <dial:DialogTitleBar DockPanel.Dock="Top"
-            TitleText="RESIZE_IMAGE" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
+            TitleKey="RESIZE_IMAGE" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
 
         <Button DockPanel.Dock="Bottom" Padding="5 0" HorizontalAlignment="Center" Margin="15"
                 Style="{StaticResource DarkRoundButton}" local:Translator.Key="RESIZE" Click="Button_Click" IsDefault="True" />

+ 1 - 1
src/PixiEditor/Views/Dialogs/SendCrashReportWindow.xaml

@@ -33,7 +33,7 @@
     </Window.CommandBindings>
 
     <StackPanel>
-        <dial:DialogTitleBar TitleText="Send crash report" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
+        <dial:DialogTitleBar TitleKey="Send crash report" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}" />
         <StackPanel Margin="10">
             <TextBlock>You can find the report here:</TextBlock>
             <StackPanel Orientation="Horizontal" HorizontalAlignment="Center">

+ 1 - 1
src/PixiEditor/Views/Dialogs/SettingsWindow.xaml

@@ -48,7 +48,7 @@
         </i:Interaction.Behaviors>
 
         <dial:DialogTitleBar DockPanel.Dock="Top"
-            TitleText="SETTINGS" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
+            TitleKey="SETTINGS" CloseCommand="{x:Static SystemCommands.CloseWindowCommand}"/>
 
         <ListBox DockPanel.Dock="Left" x:Name="pages" ItemsSource="{Binding Pages}"
                  Background="Transparent" BorderThickness="0" Width="180" ItemContainerStyle="{StaticResource PixiListBoxItemStyle}"