|
21 | 21 | </DataTemplate> |
22 | 22 | <DataTemplate x:Key="SelectColorItemTemplate" x:DataType="vmComponents:SelectedFieldViewModel"> |
23 | 23 | <ComboBox |
24 | | - Margin="04" Width="112" |
25 | | - Height="92" |
| 24 | + Margin="4" |
| 25 | + Width="112" Height="92" |
26 | 26 | ItemsSource="{Binding ElementName=ThisControl, Path=DataContext.Game.FieldValues[colors], Mode=OneWay}" |
27 | 27 | SelectedItem="{x:Bind Value, Mode=TwoWay}" |
28 | 28 | ItemTemplate="{StaticResource SelectColorTemplate}" |
29 | 29 | PlaceholderText="❓" HorizontalContentAlignment="Center" FontSize="40" /> |
30 | 30 | </DataTemplate> |
31 | 31 | </UserControl.Resources> |
32 | 32 |
|
33 | | - <Grid> |
| 33 | + <Grid x:Name="Wrapper" ColumnSpacing="15" RowSpacing="15"> |
34 | 34 | <Grid.ColumnDefinitions> |
35 | | - <ColumnDefinition Width="auto" /> |
36 | | - <ColumnDefinition Width="auto" /> |
| 35 | + <ColumnDefinition MaxWidth="500" /> |
| 36 | + <ColumnDefinition Width="Auto" /> |
37 | 37 | </Grid.ColumnDefinitions> |
| 38 | + <Grid.RowDefinitions> |
| 39 | + <RowDefinition Height="Auto" /> |
| 40 | + <RowDefinition Height="Auto" /> |
| 41 | + </Grid.RowDefinitions> |
| 42 | + <VisualStateManager.VisualStateGroups> |
| 43 | + <VisualStateGroup> |
| 44 | + <VisualState x:Name="WideState"> |
| 45 | + <VisualState.StateTriggers> |
| 46 | + <AdaptiveTrigger MinWindowWidth="800" /> |
| 47 | + </VisualState.StateTriggers> |
| 48 | + <VisualState.Setters> |
| 49 | + <Setter Target="PegComboBoxes.(Grid.Column)" Value="0" /> |
| 50 | + <Setter Target="MoveSubmitButton.(Grid.Column)" Value="1" /> |
| 51 | + <Setter Target="PegComboBoxes.(Grid.RowSpan)" Value="2" /> |
| 52 | + <Setter Target="MoveSubmitButton.(Grid.RowSpan)" Value="2" /> |
| 53 | + |
| 54 | + <Setter Target="PegComboBoxes.HorizontalAlignment" Value="Left" /> |
| 55 | + </VisualState.Setters> |
| 56 | + </VisualState> |
| 57 | + <VisualState x:Name="NarrowState"> |
| 58 | + <VisualState.StateTriggers> |
| 59 | + <AdaptiveTrigger MinWindowWidth="0" /> |
| 60 | + </VisualState.StateTriggers> |
| 61 | + <VisualState.Setters> |
| 62 | + <Setter Target="PegComboBoxes.(Grid.Row)" Value="0" /> |
| 63 | + <Setter Target="MoveSubmitButton.(Grid.Row)" Value="1" /> |
| 64 | + <Setter Target="PegComboBoxes.(Grid.ColumnSpan)" Value="2" /> |
| 65 | + <Setter Target="MoveSubmitButton.(Grid.ColumnSpan)" Value="2" /> |
| 66 | + |
| 67 | + <Setter Target="PegComboBoxes.HorizontalAlignment" Value="Center" /> |
| 68 | + </VisualState.Setters> |
| 69 | + </VisualState> |
| 70 | + </VisualStateGroup> |
| 71 | + </VisualStateManager.VisualStateGroups> |
38 | 72 | <ItemsControl |
39 | | - Grid.Column="0" |
| 73 | + x:Name="PegComboBoxes" |
40 | 74 | ItemsSource="{x:Bind Path=ViewModel.Fields, Mode=OneWay}" |
41 | 75 | ItemTemplate="{StaticResource SelectColorItemTemplate}"> |
42 | 76 | <ItemsControl.ItemsPanel> |
43 | 77 | <ItemsPanelTemplate> |
44 | | - <StackPanel Orientation="Horizontal" Margin="15,0,15,10" /> |
| 78 | + <VariableSizedWrapGrid Orientation="Horizontal" ItemWidth="112" /> |
45 | 79 | </ItemsPanelTemplate> |
46 | 80 | </ItemsControl.ItemsPanel> |
47 | 81 | </ItemsControl> |
48 | | - <Button Command="{x:Bind ViewModel.SetMoveCommand, Mode=OneTime}" Grid.Column="1" Margin="4" VerticalAlignment="Top" Height="92" Width="100"> |
| 82 | + <Button |
| 83 | + x:Name="MoveSubmitButton" |
| 84 | + Margin="4" |
| 85 | + Height="92" |
| 86 | + MinWidth="120" |
| 87 | + HorizontalAlignment="Stretch" |
| 88 | + VerticalAlignment="Stretch" |
| 89 | + Command="{x:Bind ViewModel.SetMoveCommand, Mode=OneTime}"> |
49 | 90 | <StackPanel Orientation="Vertical" Spacing="5"> |
50 | 91 | <SymbolIcon Symbol="Send" Visibility="{x:Bind ViewModel.SetMoveCommand.IsRunning, Mode=OneWay, Converter={StaticResource BoolToVisibility}, ConverterParameter=True}" /> |
51 | 92 | <ProgressRing Visibility="{x:Bind ViewModel.SetMoveCommand.IsRunning, Mode=OneWay}" /> |
|
0 commit comments