PageUserList.axaml 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  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:AvaloniaApplication5.ViewModels"
  7. x:DataType="vm:MainWindowViewModel"
  8. x:Class="AvaloniaApplication5.Views.PageUserList">
  9. <Grid ColumnDefinitions="*,*" RowDefinitions="50,*">
  10. <StackPanel Orientation="Horizontal" Grid.Row="0">
  11. <Button Content="Добавить пользователя" Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditUser}" CommandParameter="0"/>
  12. <StackPanel>
  13. <TextBlock Text="Сортировка по имени"/>
  14. <ComboBox ItemsSource="{Binding OrdersName}" SelectedValue="{Binding OrderByName}"/>
  15. </StackPanel>
  16. <StackPanel>
  17. <TextBlock Text="Фильтр по полу"/>
  18. <ComboBox ItemsSource="{Binding Genders}" SelectedValue="{Binding FilterByGender}"/>
  19. </StackPanel>
  20. <StackPanel>
  21. <TextBlock Text="Поиск по имени"/>
  22. <TextBox />
  23. </StackPanel>
  24. </StackPanel>
  25. <ListBox Grid.Column="0" Grid.Row="1" ItemsSource="{Binding UserList}">
  26. <ListBox.ItemTemplate>
  27. <DataTemplate>
  28. <StackPanel>
  29. <TextBlock Text="Имя"/>
  30. <TextBlock Text="{Binding User.Name}"/>
  31. <TextBlock Text="Логин"/>
  32. <TextBlock Text="{Binding Login}"/>
  33. <TextBlock Text="Роль в системе"/>
  34. <TextBlock Text="{Binding IdRoleNavigation.Role1}"/>
  35. <TextBlock Text="Пол"/>
  36. <TextBlock Text="{Binding User.IdGenderNavigation.Gender1}"/>
  37. <TextBlock Text="Дата рождения"/>
  38. <TextBlock Text="{Binding User.BirthDate}"/>
  39. <Button Content="Редактировать" Command="{Binding $parent[Window].((vm:MainWindowViewModel)DataContext).EditUser}" CommandParameter="{Binding Id}"/>
  40. </StackPanel>
  41. </DataTemplate>
  42. </ListBox.ItemTemplate>
  43. </ListBox>
  44. <ContentControl Grid.Column="1" Grid.Row="0" Grid.RowSpan="2" Content="{Binding UCAdmin}"/>
  45. </Grid>
  46. </UserControl>