PageStartAdmin.axaml 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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="AvaloniaApplication2.PageStartAdmin"
  7. xmlns:vm="using:AvaloniaApplication2.ViewModels"
  8. x:DataType="vm:PageStartAdminViewModel"
  9. xmlns:conv="using:AvaloniaApplication2.Resources">
  10. <UserControl.Resources>
  11. <conv:UserLogicalConverter x:Key="myUserLogicalConverter"/>
  12. </UserControl.Resources>
  13. <Grid RowDefinitions="70,*">
  14. <StackPanel Orientation="Horizontal" Grid.Row="0">
  15. <TextBlock Text="Поиск:"/>
  16. <TextBox Text="{Binding TextFind}" Watermark="Введите текст для поиска"/>
  17. <TextBlock Text="Сортировка по дате рождения:"/>
  18. <StackPanel>
  19. <RadioButton Content="По возрастанию" Command="{Binding DateSort}" CommandParameter="1"/>
  20. <RadioButton Content="По убыванию" Command="{Binding DateSort}" CommandParameter="2"/>
  21. </StackPanel>
  22. <TextBlock Text="Фильтр по полу"/>
  23. <ComboBox ItemsSource="{Binding Genders}" SelectedItem="{Binding FilteredGender}">
  24. <ComboBox.ItemTemplate>
  25. <DataTemplate>
  26. <TextBlock Text="{Binding Gender1}"/>
  27. </DataTemplate>
  28. </ComboBox.ItemTemplate>
  29. </ComboBox>
  30. </StackPanel>
  31. <ListBox ItemsSource="{Binding Users}" Grid.Row="1">
  32. <ListBox.ItemTemplate>
  33. <DataTemplate>
  34. <StackPanel Orientation="Horizontal">
  35. <StackPanel>
  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:PageStartAdminViewModel)DataContext).Press}" CommandParameter="{Binding IdUser}">
  41. <Button.IsVisible>
  42. <MultiBinding Converter="{StaticResource myUserLogicalConverter}">
  43. <Binding Path="IdUser"/>
  44. <Binding Path="((vm:PageStartAdminViewModel)DataContext).ID" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType=UserControl}"/>
  45. </MultiBinding>
  46. </Button.IsVisible>
  47. </Button>
  48. </StackPanel>
  49. <ListBox ItemsSource="{Binding IdTraits}">
  50. <ListBox.ItemTemplate>
  51. <DataTemplate>
  52. <TextBlock Text="{Binding TraitName}"/>
  53. </DataTemplate>
  54. </ListBox.ItemTemplate>
  55. </ListBox>
  56. </StackPanel>
  57. </DataTemplate>
  58. </ListBox.ItemTemplate>
  59. </ListBox>
  60. </Grid>
  61. </UserControl>