UpdateSmesharik.axaml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  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.UpdateSmesharik"
  7. xmlns:vm="using:AvaloniaApplication1.ViewModels"
  8. x:DataType="vm:UpdateSmesharikViewModel">
  9. <StackPanel>
  10. <StackPanel>
  11. <Button Content="Назад" Command="{Binding Back}"/>
  12. </StackPanel>
  13. <StackPanel Orientation="Horizontal">
  14. <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
  15. <Image Source="{Binding ImageSmesh}" Width="100" Height="100"/>
  16. <TextBlock Text="Имя:" Margin="0 5"/>
  17. <TextBox Text="{Binding Smesh.Name}"/>
  18. <TextBlock Text="Возраст:" Margin="0 5"/>
  19. <TextBox Text="{Binding Smesh.Age}" />
  20. <TextBlock Text="Пол: " Margin="0 5"/>
  21. <ComboBox ItemsSource="{Binding Genders}" SelectedItem="{Binding Smesh.GenderNavigation}">
  22. <ComboBox.ItemTemplate>
  23. <DataTemplate>
  24. <TextBlock Text="{Binding Title}"/>
  25. </DataTemplate>
  26. </ComboBox.ItemTemplate>
  27. </ComboBox>
  28. <TextBlock Text="Животное:" Margin="0 5"/>
  29. <TextBox Text="{Binding Smesh.Animal}" />
  30. <TextBlock Text="Качества:" Margin="0 5"/>
  31. <ComboBox ItemsSource="{Binding Property}" SelectedItem="{Binding SelectedProperty}" Width="150">
  32. <ComboBox.ItemTemplate>
  33. <DataTemplate>
  34. <TextBlock Text="{Binding Title}"/>
  35. </DataTemplate>
  36. </ComboBox.ItemTemplate>
  37. </ComboBox>
  38. <Button Content="Изменить фото смешарика" Command="{Binding Image}"/>
  39. <Button Content="Сохранить" Command="{Binding Save}"/>
  40. </StackPanel>
  41. <ListBox ItemsSource="{Binding Properties}" Width="150" Height="300">
  42. <ListBox.ItemTemplate>
  43. <DataTemplate>
  44. <StackPanel Orientation="Horizontal">
  45. <Button Content="-" Command="{Binding $parent[UserControl].((vm:UpdateSmesharikViewModel)DataContext).DeleteProperty}" CommandParameter="{Binding Id}"/>
  46. <TextBlock Text="{Binding Title}" Foreground="Black"/>
  47. </StackPanel>
  48. </DataTemplate>
  49. </ListBox.ItemTemplate>
  50. </ListBox>
  51. </StackPanel>
  52. </StackPanel>
  53. </UserControl>