12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <UserControl xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
- x:Class="AvaloniaApplication2.PageStartAdmin"
- xmlns:vm="using:AvaloniaApplication2.ViewModels"
- x:DataType="vm:PageStartAdminViewModel"
- xmlns:conv="using:AvaloniaApplication2.Resources">
- <UserControl.Resources>
- <conv:UserLogicalConverter x:Key="myUserLogicalConverter"/>
- </UserControl.Resources>
-
- <Grid RowDefinitions="70,*">
- <StackPanel Orientation="Horizontal" Grid.Row="0">
- <TextBlock Text="Поиск:"/>
- <TextBox Text="{Binding TextFind}" Watermark="Введите текст для поиска"/>
- <TextBlock Text="Сортировка по дате рождения:"/>
- <StackPanel>
- <RadioButton Content="По возрастанию" Command="{Binding DateSort}" CommandParameter="1"/>
- <RadioButton Content="По убыванию" Command="{Binding DateSort}" CommandParameter="2"/>
- </StackPanel>
- <TextBlock Text="Фильтр по полу"/>
- <ComboBox ItemsSource="{Binding Genders}" SelectedItem="{Binding FilteredGender}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding Gender1}"/>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- </StackPanel>
- <ListBox ItemsSource="{Binding Users}" Grid.Row="1">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Horizontal">
- <StackPanel>
- <TextBlock Text="{Binding Name, StringFormat=Имя: {0}}"/>
- <TextBlock Text="{Binding BirthDate,StringFormat=Дата рождения: {0:dd/MM/yyyy}}"/>
- <TextBlock Text="{Binding IdGenderNavigation.Gender1, StringFormat=Пол: {0}}"/>
- <TextBlock Text="{Binding IdUserNavigation.IdRoleNavigation.RoleName, StringFormat=Роль в системе: {0}}"/>
- <Button Content="Изменить персональные данные пользователя" Command="{Binding $parent[UserControl].((vm:PageStartAdminViewModel)DataContext).Press}" CommandParameter="{Binding IdUser}">
- <Button.IsVisible>
- <MultiBinding Converter="{StaticResource myUserLogicalConverter}">
- <Binding Path="IdUser"/>
- <Binding Path="((vm:PageStartAdminViewModel)DataContext).ID" RelativeSource="{RelativeSource Mode=FindAncestor,AncestorType=UserControl}"/>
- </MultiBinding>
- </Button.IsVisible>
- </Button>
- </StackPanel>
- <ListBox ItemsSource="{Binding IdTraits}">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding TraitName}"/>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </StackPanel>
-
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- </Grid>
- </UserControl>
|