CoursesList.axaml 1.6 KB

123456789101112131415161718192021222324252627282930313233
  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="AvaloniaApplication1.CoursesList"
  7. x:DataType="vm:MainWindowViewModel"
  8. xmlns:vm="using:AvaloniaApplication1.ViewModels"
  9. >
  10. <Grid RowDefinitions="*,6*">
  11. <StackPanel Orientation="Horizontal">
  12. <ComboBox Margin="10,0,0,0" Width="150" SelectedItem="{Binding CourseVM.SelectedNameOrHour}" ItemsSource="{Binding CourseVM.OrderNameOrHours}"/>
  13. <ComboBox Margin="10,0,0,0" Width="150" SelectedItem="{Binding CourseVM.SelectedFilter}" ItemsSource="{Binding CourseVM.FilterByHours}"/>
  14. <TextBox Margin="100,0,0,0" Width="300" Text="{Binding CourseVM.NameOrHoursFind}" Watermark="Поиск по имени или количеству часов"></TextBox>
  15. </StackPanel>
  16. <ListBox ItemsSource="{Binding CourseVM.Courses}" Grid.Row="1">
  17. <ListBox.ItemTemplate>
  18. <DataTemplate>
  19. <Border CornerRadius="4" BorderBrush="DarkGreen" BorderThickness="1" Padding="15">
  20. <StackPanel>
  21. <TextBlock Text="{Binding Course1}"></TextBlock>
  22. <TextBlock Text="{Binding HoursCount}"></TextBlock>
  23. <TextBlock Text="{Binding CountTeachers}"></TextBlock>
  24. </StackPanel>
  25. </Border>
  26. </DataTemplate>
  27. </ListBox.ItemTemplate>
  28. </ListBox>
  29. </Grid>
  30. </UserControl>