AddSmesh.axaml 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  4. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  5. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  6. x:Class="AvaloniaApplication1.AddSmesh"
  7. xmlns:vm="using:AvaloniaApplication1.ViewModels"
  8. x:DataType="vm:AddSmeshViewModel">
  9. <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Center">
  10. <StackPanel Orientation="Vertical">
  11. <Image Source="{Binding ImageSmesh}" Width="100" Height="100"/>
  12. <TextBlock Text="Имя" Margin="0 5"/>
  13. <TextBox Text="{Binding Name}" Watermark="Введите имя" Margin="0 5"/>
  14. <TextBlock Text="Возраст" Margin="0 5"/>
  15. <TextBox Text="{Binding Age}" Watermark="Введите возраст" Margin="0 5"/>
  16. <TextBlock Text="Животное" Margin="0 5"/>
  17. <TextBox Text="{Binding Animal}" Watermark="Введите животное" Margin="0 5"/>
  18. <TextBlock Text="Выберете пол: " Margin="0 5"/>
  19. <ComboBox ItemsSource="{Binding Genders}" SelectedItem="{Binding SelectedGender}" Width="150">
  20. <ComboBox.ItemTemplate>
  21. <DataTemplate>
  22. <TextBlock Text="{Binding Title}"/>
  23. </DataTemplate>
  24. </ComboBox.ItemTemplate>
  25. </ComboBox>
  26. <TextBlock Text="Выберете качества: " Margin="0 5"/>
  27. <ComboBox ItemsSource="{Binding Property}" SelectedItem="{Binding SelectedProperty}" Width="150">
  28. <ComboBox.ItemTemplate>
  29. <DataTemplate>
  30. <TextBlock Text="{Binding Title}"/>
  31. </DataTemplate>
  32. </ComboBox.ItemTemplate>
  33. </ComboBox>
  34. <Button Content="Добавить фото" Command="{Binding AddImage}" Margin="0 5" Width="150"/>
  35. <Button Content="Сохранить" Command="{Binding Save}" Margin="0 5" Width="150"/>
  36. </StackPanel>
  37. <ListBox ItemsSource="{Binding Items}" Width="150" Height="300">
  38. <ListBox.ItemTemplate>
  39. <DataTemplate>
  40. <StackPanel Orientation="Horizontal">
  41. <Button Content="-" Command="{Binding $parent[UserControl].((vm:AddSmeshViewModel)DataContext).DeleteItem}" CommandParameter="{Binding Id}"/>
  42. <TextBlock Text="{Binding Title}" Foreground="Black"/>
  43. </StackPanel>
  44. </DataTemplate>
  45. </ListBox.ItemTemplate>
  46. </ListBox>
  47. </StackPanel>
  48. </UserControl>