AllEmployees.axaml 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  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="1000" d:DesignHeight="990"
  6. x:Class="AvaloniaApplication4.Views.ActionPages.AllEmployees"
  7. xmlns:vm="using:AvaloniaApplication4.ViewModels"
  8. x:DataType="vm:AllEmployeesViewModel"
  9. Background="White"
  10. Padding="80">
  11. <ScrollViewer>
  12. <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0 20 0 0">
  13. <TextBlock Margin="0 0 0 36" Text="Сотрудники" Classes="titleStyle" FontWeight="Bold"/>
  14. <Button Command="{Binding $parent[UserControl].((vm:AllEmployeesViewModel)DataContext).AddUser}" Margin="0 0 0 36" Content="Добавить нового сотрудника" HorizontalAlignment="Stretch"/>
  15. <TextBox Text="{Binding Search, Mode=TwoWay}" Margin="0 0 0 36" TextWrapping="NoWrap" Height="52" Watermark="Найдите нужного сотрудника" HorizontalAlignment="Stretch"/>
  16. <ListBox ItemsSource="{Binding AllUsers}">
  17. <ListBox.ItemTemplate>
  18. <DataTemplate>
  19. <Grid Margin="0 0 0 15">
  20. <Grid.ColumnDefinitions>
  21. <ColumnDefinition Width="3*"/>
  22. <ColumnDefinition Width="1*"/>
  23. </Grid.ColumnDefinitions>
  24. <StackPanel Orientation="Horizontal" Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Stretch">
  25. <TextBlock Text="{Binding Surname}" Classes="mediumText" TextWrapping="Wrap"/>
  26. <TextBlock Classes="mediumText" Text=" " TextWrapping="Wrap"/>
  27. <TextBlock Text="{Binding Name}" Classes="mediumText" TextWrapping="Wrap"/>
  28. <TextBlock Classes="mediumText" Text=" " TextWrapping="Wrap"/>
  29. <TextBlock Text="{Binding Patronumic}" Classes="mediumText" TextWrapping="Wrap"/>
  30. </StackPanel>
  31. <Button Command="{Binding $parent[UserControl].((vm:AllEmployeesViewModel)DataContext).EditUser}" CommandParameter="{Binding IdUser}" Content="Редактировать" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  32. </Grid>
  33. </DataTemplate>
  34. </ListBox.ItemTemplate>
  35. </ListBox>
  36. </StackPanel>
  37. </ScrollViewer>
  38. </UserControl>