PageUserList.axaml 2.6 KB

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