|
28 | 28 | <TabControl x:Name="Tabs" Grid.Row="1" Margin="16"> |
29 | 29 | <TabItem Header="{x:Static resources:Strings.Common_AddSingle}" > |
30 | 30 | <Border Margin="16" Padding="16" Background="#0AFFFFFF" CornerRadius="12"> |
31 | | - <Grid> |
32 | | - <Grid.RowDefinitions> |
33 | | - <RowDefinition Height="Auto"/> |
34 | | - <RowDefinition Height="Auto"/> |
35 | | - </Grid.RowDefinitions> |
| 31 | + <Grid Grid.Row="1" Grid.RowDefinitions="Auto, Auto" Grid.ColumnDefinitions="Auto, *"> |
| 32 | + <TextBlock Grid.Row="0" Grid.Column="0" VerticalAlignment="Center" MinWidth="100" Text="{x:Static resources:Strings.Common_Name}" Margin="0,0,0,12" /> |
| 33 | + <TextBox Grid.Row="0" Grid.Column="1" Name="FlagNameTextBox" Margin="0,0,0,12" /> |
36 | 34 |
|
37 | | - <StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,12" VerticalAlignment="Center"> |
38 | | - <TextBlock Text="{x:Static resources:Strings.Common_Name}" FontWeight="SemiBold" Width="120" VerticalAlignment="Center"/> |
39 | | - <TextBox x:Name="FlagNameTextBox" Width="220"/> |
40 | | - </StackPanel> |
41 | | - |
42 | | - <StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,0,0,12" VerticalAlignment="Center"> |
43 | | - <TextBlock Text="{x:Static resources:Strings.Common_Value}" FontWeight="SemiBold" Width="120" VerticalAlignment="Center"/> |
44 | | - |
45 | | - <ComboBox x:Name="FlagValueComboBox" Width="220" IsEditable="True" IsTextSearchEnabled="False" StaysOpenOnEdit="True" ItemsSource="{Binding CommonValuesView.View}" SelectedValueBinding="{Binding Value}" Loaded="FlagValueComboBox_Loaded" > |
46 | | - <ComboBox.ItemTemplate> |
47 | | - <DataTemplate> |
48 | | - <StackPanel Orientation="Horizontal" Margin="2"> |
49 | | - <TextBlock Text="{Binding Value}" Width="160"/> |
50 | | - <TextBlock Text="{Binding Group}" Foreground="Gray" FontSize="10" VerticalAlignment="Center"/> |
51 | | - </StackPanel> |
52 | | - </DataTemplate> |
53 | | - </ComboBox.ItemTemplate> |
54 | | - |
55 | | - <ComboBox.Resources> |
56 | | - <Style TargetType="{x:Type GroupItem}"> |
57 | | - <Setter Property="Template"> |
58 | | - <Setter.Value> |
59 | | - <ControlTemplate TargetType="{x:Type GroupItem}"> |
60 | | - <StackPanel> |
61 | | - <TextBlock Text="{Binding Name}" FontWeight="Bold" Margin="4,6,0,2" Foreground="SlateGray" FontSize="12" /> |
62 | | - <ItemsPresenter/> |
63 | | - </StackPanel> |
64 | | - </ControlTemplate> |
65 | | - </Setter.Value> |
66 | | - </Setter> |
67 | | - </Style> |
68 | | - </ComboBox.Resources> |
69 | | - </ComboBox> |
70 | | - </StackPanel> |
71 | | - </Grid> |
| 35 | + <TextBlock Grid.Row="1" Grid.Column="0" VerticalAlignment="Center" MinWidth="100" Text="{x:Static resources:Strings.Common_Value}" /> |
| 36 | + <TextBox Grid.Row="1" Grid.Column="1" Name="FlagValueTextBox" /> |
| 37 | + </Grid> |
72 | 38 | </Border> |
73 | 39 | </TabItem> |
74 | 40 |
|
75 | 41 | <TabItem Header="{x:Static resources:Strings.Common_ImportJson}" > |
76 | 42 | <Border Margin="16" Padding="16" Background="#0AFFFFFF" CornerRadius="12"> |
77 | | - <Grid> |
78 | | - <Grid.RowDefinitions> |
79 | | - <RowDefinition Height="*" /> |
80 | | - <RowDefinition Height="Auto" /> |
81 | | - </Grid.RowDefinitions> |
| 43 | + <Grid Grid.RowDefinitions="*, *"> |
82 | 44 | <TextBox Grid.Row="0" x:Name="JsonTextBox" Margin="5" AcceptsTab="True" AcceptsReturn="True" MinHeight="80" MaxHeight="480" /> |
83 | | - <TextBlock Grid.Row="0" IsHitTestVisible="False" Margin="18,14,0,0" Foreground="DarkGray" Text="{}{ "FFlagDebugDisplayFPS": "True" }"> |
84 | | - <TextBlock.Style> |
85 | | - <Style TargetType="{x:Type TextBlock}"> |
86 | | - <Setter Property="IsVisible" Value="False"/> |
87 | | - <Style.Triggers> |
88 | | - <DataTrigger Binding="{Binding Text, ElementName=JsonTextBox}" Value=""> |
89 | | - <Setter Property="IsVisible" Value="True"/> |
90 | | - </DataTrigger> |
91 | | - </Style.Triggers> |
92 | | - </Style> |
93 | | - </TextBlock.Style> |
94 | | - </TextBlock> |
95 | | - <ui:Button Grid.Row="1" Margin="4,12,4,0" Icon="DocumentArrowUp16" Content="{x:Static resources:Strings.Common_ImportFromFile}" HorizontalAlignment="Stretch" Click="ImportButton_Click" /> |
96 | | - </Grid> |
| 45 | + <TextBlock Grid.Row="0" |
| 46 | + IsHitTestVisible="False" |
| 47 | + Margin="18,14,0,0" |
| 48 | + Foreground="DarkGray" |
| 49 | + Text="{}{ "FFlagDebugDisplayFPS": "True" }" |
| 50 | + IsVisible="{Binding #JsonTextBox.Text, Converter={x:Static StringConverters.IsNullOrEmpty}}"/> |
| 51 | + <Button Grid.Row="1" Margin="4" HorizontalAlignment="Stretch" Click="ImportButton_Click"> |
| 52 | + <StackPanel Orientation="Horizontal" Spacing="8"> |
| 53 | + <ui:SymbolIcon Symbol="Document" /> |
| 54 | + <TextBlock Text="{x:Static resources:Strings.Common_ImportFromFile}" /> |
| 55 | + </StackPanel> |
| 56 | + </Button> |
| 57 | + </Grid> |
97 | 58 | </Border> |
98 | 59 | </TabItem> |
99 | 60 | </TabControl> |
100 | 61 |
|
101 | 62 | <Border Grid.Row="2" Margin="0,10,0,0" Padding="15" Background="{DynamicResource PrimaryBackgroundColor}"> |
102 | 63 | <StackPanel Orientation="Horizontal" FlowDirection="LeftToRight" HorizontalAlignment="Right"> |
103 | | - <Button MinWidth="100" Content="{x:Static resources:Strings.Common_OK}" Click="OKButton_Click" > |
104 | | - <Button.Style> |
105 | | - <Style TargetType="Button" BasedOn="{StaticResource {x:Type Button}}"> |
106 | | - <Style.Triggers> |
107 | | - <MultiDataTrigger> |
108 | | - <MultiDataTrigger.Conditions> |
109 | | - <Condition Binding="{Binding ElementName=Tabs, Path=SelectedIndex}" Value="0" /> |
110 | | - <Condition Binding="{Binding ElementName=FlagNameTextBox, Path=Text.Length, Converter={StaticResource ValidationConverter}}" Value="True" /> |
111 | | - </MultiDataTrigger.Conditions> |
112 | | - <Setter Property="IsEnabled" Value="True" /> |
113 | | - </MultiDataTrigger> |
114 | | - <MultiDataTrigger> |
115 | | - <MultiDataTrigger.Conditions> |
116 | | - <Condition Binding="{Binding ElementName=Tabs, Path=SelectedIndex}" Value="1" /> |
117 | | - <Condition Binding="{Binding ElementName=JsonTextBox, Path=Text.Length, Converter={StaticResource ValidationConverter}}" Value="True" /> |
118 | | - </MultiDataTrigger.Conditions> |
119 | | - <Setter Property="IsEnabled" Value="True" /> |
120 | | - </MultiDataTrigger> |
121 | | - <MultiDataTrigger> |
122 | | - <MultiDataTrigger.Conditions> |
123 | | - <Condition Binding="{Binding ElementName=Tabs, Path=SelectedIndex}" Value="2" /> |
124 | | - <Condition Binding="{Binding ElementName=GameFlagNameTextBox, Path=Text.Length, Converter={StaticResource ValidationConverter}}" Value="True" /> |
125 | | - <Condition Binding="{Binding ElementName=FlagNameTextBox, Path=Text, Converter={StaticResource ValidationConverter}}" Value="True" /> |
126 | | - <Condition Binding="{Binding ElementName=GameFlagIdTextBox, Path=Text.Length, Converter={StaticResource ValidationConverter}}" Value="True" /> |
127 | | - </MultiDataTrigger.Conditions> |
128 | | - <Setter Property="IsEnabled" Value="True" /> |
129 | | - </MultiDataTrigger> |
130 | | - <MultiDataTrigger> |
131 | | - <MultiDataTrigger.Conditions> |
132 | | - <Condition Binding="{Binding ElementName=Tabs, Path=SelectedIndex}" Value="3" /> |
133 | | - <Condition Binding="{Binding ElementName=GameIdJsonTextBox, Path=Text.Length, Converter={StaticResource ValidationConverter}}" Value="True" /> |
134 | | - <Condition Binding="{Binding ElementName=ImportGameIdTextBox, Path=Text.Length, Converter={StaticResource ValidationConverter}}" Value="True" /> |
135 | | - </MultiDataTrigger.Conditions> |
136 | | - <Setter Property="IsEnabled" Value="True" /> |
137 | | - </MultiDataTrigger> |
138 | | - </Style.Triggers> |
139 | | - <Setter Property="IsEnabled" Value="False" /> |
140 | | - </Style> |
141 | | - </Button.Style> |
142 | | - </Button> |
| 64 | + <Button MinWidth="100" Content="{x:Static resources:Strings.Common_OK}" Click="OKButton_Click" IsEnabled="False"/> |
143 | 65 | <Button MinWidth="100" Margin="12,0,0,0" Content="{x:Static resources:Strings.Common_Cancel}" IsCancel="True" /> |
144 | 66 | </StackPanel> |
145 | 67 | </Border> |
|
0 commit comments