PageForCreateCharacter.axaml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:vm="using:AvaloniaApplicationKuzminIV.ViewModels"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  7. x:Class="AvaloniaApplicationKuzminIV.PageForCreateCharacter"
  8. x:DataType="vm:PageCreateCharacterViewModel">
  9. <Grid>
  10. <Grid.ColumnDefinitions>
  11. <ColumnDefinition Width="*" />
  12. <ColumnDefinition Width="*" />
  13. <ColumnDefinition Width="*" />
  14. </Grid.ColumnDefinitions>
  15. <Grid.RowDefinitions>
  16. <RowDefinition Height="Auto" />
  17. <RowDefinition Height="Auto" />
  18. <RowDefinition Height="Auto" />
  19. <RowDefinition Height="Auto" />
  20. <RowDefinition Height="Auto" />
  21. <RowDefinition Height="Auto" />
  22. <RowDefinition Height="Auto" />
  23. <RowDefinition Height="Auto" />
  24. <RowDefinition Height="Auto" />
  25. </Grid.RowDefinitions>
  26. <TextBlock Grid.Row="0" Grid.Column="1" Classes ="Header" Text="Создай своего персонажа" FontWeight="Bold" FontSize="20" HorizontalAlignment="Center" Margin="0, 10" />
  27. <Button Command="{Binding ExitFrom}" Content="Выход" Margin="5" BorderThickness="1" BorderBrush="Black" CornerRadius="8" HorizontalAlignment="Left" VerticalAlignment="Center" />
  28. <Button Grid.Row="1" Command="{Binding BackFromCreateCharacterr}" Content="Вернуться к персонажам" Margin="5" BorderThickness="1" BorderBrush="Black" CornerRadius="8" HorizontalAlignment="Left" VerticalAlignment="Center" />
  29. <TextBlock Grid.Row="1" Text="Имя" Classes ="Default" Margin="5" TextAlignment="Right" />
  30. <TextBox Grid.Row="1" Text="{Binding Sname}" Grid.Column="1" Name="LastNametb" Margin="5" />
  31. <TextBlock Grid.Row="4" Text="Дата создания" Classes ="Default" Margin="5" TextAlignment="Right" />
  32. <DatePicker Grid.Row="4" SelectedDate="{Binding DobMyCharacter}" Grid.Column="1" Name="DobPicker" Margin="5" />
  33. <TextBlock Grid.Row="5" Classes ="Default" Text="Пол" Margin="5" TextAlignment="Right" />
  34. <ComboBox Grid.Row="5" ItemsSource="{Binding Genders}" Grid.Column="1" Name="GenderCombobox" Margin="5" SelectedItem="{Binding GenderId}">
  35. <ComboBox.ItemTemplate>
  36. <DataTemplate>
  37. <TextBlock Text= "{Binding Title}"/>
  38. </DataTemplate>
  39. </ComboBox.ItemTemplate>
  40. </ComboBox>
  41. <StackPanel Orientation="Horizontal" Grid.Row="6" Grid.Column="1">
  42. <TextBlock Text="Качества" Classes="Default" Margin="5" TextAlignment="Right" />
  43. <ListBox Grid.Row="6" Grid.Column="1" Name="PropertyListBox" Margin="5" ItemsSource="{Binding Properties}" SelectedItem="{Binding SelectProperty}">
  44. <ListBox.ItemTemplate>
  45. <DataTemplate>
  46. <TextBlock Text="{Binding Propertyname}" />
  47. </DataTemplate>
  48. </ListBox.ItemTemplate>
  49. </ListBox>
  50. <ListBox Name="PropertyNewListBox" Margin="5" ItemsSource="{Binding SelectedProperties}">
  51. <ListBox.ItemTemplate>
  52. <DataTemplate>
  53. <StackPanel Orientation="Horizontal">
  54. <Button Content="X" Command="{Binding $parent[UserControl].((vm:PageCreateCharacterViewModel)DataContext).RemoveFromSelectedProperties }" CommandParameter="{Binding Id}" />
  55. <TextBlock Text="{Binding Propertyname}" />
  56. </StackPanel>
  57. </DataTemplate>
  58. </ListBox.ItemTemplate>
  59. </ListBox>
  60. </StackPanel>
  61. <!--asdasd-->
  62. <Button Command="{Binding OnCreate}" BorderThickness="1" BorderBrush="Black" CornerRadius="10" Grid.Row="8" Grid.ColumnSpan="3" Content="Создать" Background="LightGreen" HorizontalAlignment="Center" Margin="10" />
  63. </Grid>
  64. </UserControl>