In code: "<Window x:Class="FifteenGame.Wpf.MainWindow"…
- User
In code: " <Window.DataContext> viewmodels:MainWindowViewModel/ </Window.DataContext>
code<Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition /> <ColumnDefinition Width="Auto" /> <ColumnDefinition /> </Grid.ColumnDefinitions> <Grid Grid.Row="0" Grid.Column="1"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <StackPanel Grid.Row="0" Orientation="Horizontal"> <TextBlock Text="Игрок:" FontSize="18" Margin="5" /> <TextBlock Text="{Binding UserName}" FontSize="18" Margin="5" /> </StackPanel> <StackPanel Grid.Row="1" Orientation="Horizontal"> <TextBlock Text="Число ходов:" FontSize="18" Margin="5" /> <TextBlock Text="{Binding MoveCountText}" FontSize="18" Margin="5" /> </StackPanel> </Grid> <ItemsControl Grid.Column="1" Grid.Row="1" ItemsSource="{Binding Cells}"> <ItemsControl.ItemsPanel> <ItemsPanelTemplate> <Grid> <Grid.RowDefinitions> <RowDefinition Height="100" /> <RowDefinition Height="100" /> <RowDefinition Height="100" /> <RowDefinition Height="100" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="100" /> <ColumnDefinition Width="100" /> <ColumnDefinition Width="100" /> <ColumnDefinition Width="100" /> </Grid.ColumnDefinitions> </Grid> </ItemsPanelTemplate> </ItemsControl.ItemsPanel> <ItemsControl.ItemTemplate> <DataTemplate> <Grid MouseDown="Grid_MouseDown" Tag="{Binding Direction}"> <Rectangle Margin="5" Stroke="Brown" StrokeThickness="3" RadiusX="10" RadiusY="10" Fill="LightBlue" /> <TextBlock Text="{Binding Text}" FontSize="36" HorizontalAlignment="Center" VerticalAlignment="Center" /> </Grid> </DataTemplate> </ItemsControl.ItemTemplate> <ItemsControl.ItemContainerStyle> <Style TargetType="ContentPresenter"> <Setter Property="Grid.Row" Value="{Binding Row}" /> <Setter Property="Grid.Column" Value="{Binding Column}" /> </Style> </ItemsControl.ItemContainerStyle> </ItemsControl> </Grid> - Assistant