|
7 | 7 | xmlns:d="http://schemas.microsoft.com/expression/blend/2008" |
8 | 8 | xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" |
9 | 9 | xmlns:vmComponents="using:Codebreaker.ViewModels.Components" |
| 10 | + xmlns:models="using:Codebreaker.ViewModels.Models" |
10 | 11 | xmlns:toolkitConverters="using:CommunityToolkit.WinUI.UI.Converters" |
11 | 12 | xmlns:cme="using:CodeBreaker.WinUI.CustomMarkupExtensions" |
12 | 13 | mc:Ignorable="d" |
13 | 14 | x:Name="ThisControl"> |
14 | 15 |
|
15 | 16 | <UserControl.Resources> |
16 | 17 | <toolkitConverters:BoolToVisibilityConverter x:Key="BoolToVisibility" /> |
17 | | - <DataTemplate x:Key="SelectColorTemplate"> |
| 18 | + <DataTemplate x:Key="SelectColorTemplate" x:DataType="x:String"> |
18 | 19 | <Grid> |
19 | | - <Ellipse Fill="{Binding Mode=OneWay, Converter={StaticResource ColorConverter}}" Width="60" Height="60" /> |
| 20 | + <Ellipse Fill="{x:Bind Mode=OneWay, Converter={StaticResource ColorConverter}}" Width="60" Height="60" /> |
20 | 21 | </Grid> |
21 | 22 | </DataTemplate> |
22 | | - <DataTemplate x:Key="SelectColorItemTemplate" x:DataType="vmComponents:SelectedFieldViewModel"> |
| 23 | + <DataTemplate x:Key="SelectColorItemTemplate" x:DataType="models:Field"> |
23 | 24 | <ComboBox |
24 | 25 | Margin="04" Width="112" |
25 | 26 | Height="92" |
26 | | - ItemsSource="{Binding ElementName=ThisControl, Path=DataContext.Game.FieldValues[colors], Mode=OneWay}" |
27 | | - SelectedItem="{x:Bind Path=Value, Mode=TwoWay}" |
| 27 | + ItemsSource="{x:Bind PossibleColors, Mode=OneTime}" |
| 28 | + SelectedItem="{x:Bind Color, Mode=TwoWay}" |
28 | 29 | ItemTemplate="{StaticResource SelectColorTemplate}" |
29 | 30 | PlaceholderText="❓" HorizontalContentAlignment="Center" FontSize="40" /> |
30 | 31 | </DataTemplate> |
|
37 | 38 | </Grid.ColumnDefinitions> |
38 | 39 | <ItemsControl |
39 | 40 | Grid.Column="0" |
40 | | - ItemsSource="{x:Bind Path=ViewModel.Fields, Mode=OneWay}" |
| 41 | + ItemsSource="{x:Bind Path=ViewModel.SelectedFields, Mode=OneWay}" |
41 | 42 | ItemTemplate="{StaticResource SelectColorItemTemplate}"> |
42 | 43 | <ItemsControl.ItemsPanel> |
43 | 44 | <ItemsPanelTemplate> |
44 | 45 | <StackPanel Orientation="Horizontal" Margin="15,0,15,10" /> |
45 | 46 | </ItemsPanelTemplate> |
46 | 47 | </ItemsControl.ItemsPanel> |
47 | 48 | </ItemsControl> |
48 | | - <Button Command="{x:Bind ViewModel.SetMoveCommand, Mode=OneTime}" Grid.Column="1" Margin="4" VerticalAlignment="Top" Height="92" Width="100"> |
| 49 | + <Button Command="{x:Bind ViewModel.MakeMoveCommand, Mode=OneTime}" Grid.Column="1" Margin="4" VerticalAlignment="Top" Height="92" Width="100"> |
49 | 50 | <StackPanel Orientation="Vertical" Spacing="5"> |
50 | | - <SymbolIcon Symbol="Send" Visibility="{x:Bind ViewModel.SetMoveCommand.IsRunning, Mode=OneWay, Converter={StaticResource BoolToVisibility}, ConverterParameter=True}" /> |
51 | | - <ProgressRing Visibility="{x:Bind ViewModel.SetMoveCommand.IsRunning, Mode=OneWay}" /> |
| 51 | + <SymbolIcon Symbol="Send" Visibility="{x:Bind ViewModel.MakeMoveCommand.IsRunning, Mode=OneWay, Converter={StaticResource BoolToVisibility}, ConverterParameter=True}" /> |
| 52 | + <ProgressRing Visibility="{x:Bind ViewModel.MakeMoveCommand.IsRunning, Mode=OneWay}" /> |
52 | 53 | <TextBlock Text="{cme:ResourceString Name=PegSelection_MakeMove}" /> |
53 | 54 | </StackPanel> |
54 | 55 | </Button> |
|
0 commit comments