InfoUsersDate.axaml 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  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. xmlns:vm="using:TestRepeat.ViewModels"
  7. x:DataType="vm:InfoUsersDateViewModel"
  8. x:Class="TestRepeat.Views.InfoUsersDate">
  9. <Grid RowDefinitions="100, *">
  10. <StackPanel
  11. Orientation="Horizontal">
  12. <TextBlock
  13. Text="Поиск в базе:"/>
  14. <TextBox
  15. Text="{Binding TextFolderContent}"
  16. Watermark="Поиск"/>
  17. <TextBlock
  18. Text="Сортировка по дате рождения:"/>
  19. <StackPanel>
  20. <RadioButton
  21. Content="По убывания"
  22. CommandParameter="1"
  23. Command="{Binding DateSort}"/>
  24. <RadioButton
  25. Content="По возрастанию"
  26. CommandParameter="2"
  27. Command="{Binding DateSort}"/>
  28. </StackPanel>
  29. <TextBlock
  30. Text="Фильтр по полу"/>
  31. <ComboBox
  32. ItemsSource="{Binding ListGenders}"
  33. SelectedItem="{Binding SelectedGender}">
  34. <ComboBox.ItemTemplate>
  35. <DataTemplate>
  36. <TextBlock
  37. Text="{Binding Gender1}"/>
  38. </DataTemplate>
  39. </ComboBox.ItemTemplate>
  40. </ComboBox>
  41. <Button
  42. Content="Создать пользователя"
  43. Command="{Binding AddNewUser}"/>
  44. </StackPanel>
  45. <ListBox
  46. Grid.Row="1"
  47. ItemsSource="{Binding ListUsers}">
  48. <ListBox.ItemTemplate>
  49. <DataTemplate>
  50. <Grid
  51. ColumnDefinitions="*, *"
  52. ShowGridLines="True">
  53. <StackPanel
  54. Grid.Column="0">
  55. <TextBlock
  56. Text="{Binding Name}"/>
  57. <TextBlock
  58. Text="{Binding BirthDate, StringFormat=Дата рождения: {0: dd/MM/yyyy}}"/>
  59. <TextBlock
  60. Text="{Binding IdGenderNavigation.Gender1}"/>
  61. <TextBlock
  62. Text="{Binding IdUserNavigation.IdRoleNavigation.RoleName}"/>
  63. <Button
  64. Command="{Binding $parent[UserControl].((vm:InfoUsersDateViewModel)DataContext).ChangeUserDate}"
  65. Content="Изменить данные пользователя"
  66. CommandParameter="{Binding IdUser}"/>
  67. <Button
  68. Command="{Binding $parent[UserControl].((vm:InfoUsersDateViewModel)DataContext).DeleteUser}"
  69. Content="Удалить пользователя"
  70. CommandParameter="{Binding IdUser}"
  71. IsVisible="{Binding IsCanseled}"
  72. />
  73. </StackPanel>
  74. <Grid
  75. ColumnDefinitions="*, *"
  76. Grid.Column="1"
  77. ShowGridLines="True">
  78. <ListBox
  79. ItemsSource="{Binding IdThreats}">
  80. <ListBox.ItemTemplate>
  81. <DataTemplate>
  82. <TextBlock
  83. Text="{Binding Name}"/>
  84. </DataTemplate>
  85. </ListBox.ItemTemplate>
  86. </ListBox>
  87. <Image
  88. Grid.Column="1"
  89. Source="{Binding ConvertImgUser}"
  90. Width="150"
  91. Height="150"/>
  92. </Grid>
  93. </Grid>
  94. </DataTemplate>
  95. </ListBox.ItemTemplate>
  96. </ListBox>
  97. </Grid>
  98. </UserControl>