AdminPage.axaml 2.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <UserControl xmlns="https://github.com/avaloniaui"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:vm="using:AvaloniaApplicationTestNew.ViewModels"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
  7. x:Class="AvaloniaApplicationTestNew.AdminPage"
  8. x:DataType="vm:AdminPageViewModel">
  9. <Grid RowDefinitions="75,50,*" ColumnDefinitions="*,*,*">
  10. <StackPanel Orientation="Horizontal" Grid.Row="0" Margin="0 10 0 10">
  11. <TextBlock Text="Поиск:"/>
  12. <TextBox Text="{Binding FindText}" Watermark="Введите текст для поиска"/>
  13. <TextBlock Text="Сортировка по дате рождения:"/>
  14. <StackPanel>
  15. <RadioButton Content="По возрастанию" Command="{Binding SortDate}" CommandParameter="1"/>
  16. <RadioButton Content="По Убыванию" Command="{Binding SortDate}" CommandParameter="2"/>
  17. </StackPanel>
  18. <TextBlock Text="Фильтр по полу:"/>
  19. <ComboBox ItemsSource="{Binding Genders}" SelectedItem="{Binding FiltGendr}">
  20. <ComboBox.ItemTemplate>
  21. <DataTemplate>
  22. <TextBlock Text="{Binding Gender1}"/>
  23. </DataTemplate>
  24. </ComboBox.ItemTemplate>
  25. </ComboBox>
  26. </StackPanel>
  27. <StackPanel Grid.Row="1" Grid.ColumnSpan="3" HorizontalAlignment="Center" Orientation="Horizontal">
  28. <Button Content="Добавить пользователя" Command="{Binding AddUser}"/>
  29. <Button Content="Выйти" Command="{Binding Exit}"/>
  30. </StackPanel>
  31. <ListBox ItemsSource="{Binding LocalListusers}" Grid.Row="2" Background="Linen" Grid.ColumnSpan="3">
  32. <ListBox.ItemTemplate>
  33. <DataTemplate>
  34. <StackPanel>
  35. <StackPanel Grid.Column="1">
  36. <TextBlock Text="{Binding Name, StringFormat=Имя: {0}}"/>
  37. <TextBlock Text="{Binding BirthDate, StringFormat=Дата рождения: {0:dd/MM/yyyy}}"/>
  38. <TextBlock Text="{Binding IdGenderNavigation.Gender1, StringFormat=Пол: {0}}"/>
  39. <TextBlock Text="{Binding IdUserNavigation.IdRoleNavigation.RoleName, StringFormat=Роль в системе: {0}}"/>
  40. <Button Content="Изменить персональные данные пользователя" Command="{Binding $parent[UserControl].((vm:AdminPageViewModel)DataContext).InfoUsers}" CommandParameter="{Binding IdUser}"/>
  41. </StackPanel>
  42. <ListBox ItemsSource="{Binding IdTraits}" Grid.Column="2" Grid.Row="2">
  43. <ListBox.ItemTemplate>
  44. <DataTemplate>
  45. <TextBlock Text="{Binding Traitname}"/>
  46. </DataTemplate>
  47. </ListBox.ItemTemplate>
  48. </ListBox>
  49. <Image Source="{Binding ConvertImage}" Width="150" Height="150" Grid.Row="2" Grid.Column="3"/>
  50. </StackPanel>
  51. </DataTemplate>
  52. </ListBox.ItemTemplate>
  53. </ListBox>
  54. </Grid>
  55. </UserControl>