AdminUsers.axaml 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  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.AdminUsers"
  7. xmlns:vm="using:AvaloniaApplication1.ViewModels"
  8. x:DataType="vm:AdminUsersViewModel">
  9. <Grid RowDefinitions="50,*" Grid.Column="1" Grid.Row="1">
  10. <StackPanel Orientation="Horizontal">
  11. <TextBox Text="{Binding Search}" Width="200" Watermark="Введите имя: "></TextBox>
  12. <ComboBox ItemsSource="{Binding Genders}" SelectedItem="{Binding SelectedGender}">
  13. <ComboBox.ItemTemplate>
  14. <DataTemplate>
  15. <TextBlock Text="{Binding Title}"/>
  16. </DataTemplate>
  17. </ComboBox.ItemTemplate>
  18. </ComboBox>
  19. <StackPanel Orientation="Horizontal">
  20. <RadioButton Content="По возрастанию" Command="{Binding OrderByAge}" CommandParameter="1"></RadioButton>
  21. <RadioButton Content="По убыванию" Command="{Binding OrderByAge}" CommandParameter="2"></RadioButton>
  22. </StackPanel>
  23. </StackPanel>
  24. <ListBox ItemsSource="{Binding Users}" Grid.Row="1">
  25. <ListBox.ItemTemplate>
  26. <DataTemplate>
  27. <StackPanel Orientation="Horizontal">
  28. <StackPanel>
  29. <TextBlock Text="{Binding LastName, StringFormat= Фамилия: {0}}"></TextBlock>
  30. <TextBlock Text="{Binding FirstName, StringFormat= Имя: {0}}"></TextBlock>
  31. <TextBlock Text="{Binding Patronymic, StringFormat= Отчество: {0}}"></TextBlock>
  32. <TextBlock Text="{Binding DateOfBirth, StringFormat= Дата рождения: {0:dd.MM.yyyy}}"></TextBlock>
  33. <TextBlock Text="{Binding GenderNavigation.Title, StringFormat= Пол: {0}}"></TextBlock>
  34. <Button Content="Удалить" Command="{Binding $parent[UserControl].((vm:AdminUsersViewModel)DataContext).Drop}" CommandParameter="{Binding Id}"/>
  35. <Button Content="Изменить" Command="{Binding $parent[UserControl].((vm:AdminUsersViewModel)DataContext).Update}" CommandParameter="{Binding Id}"/>
  36. </StackPanel>
  37. </StackPanel>
  38. </DataTemplate>
  39. </ListBox.ItemTemplate>
  40. </ListBox>
  41. </Grid>
  42. </UserControl>