MyPrograms.axaml 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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.MyPrograms"
  7. xmlns:vm="using:AvaloniaApplication4.ViewModels"
  8. x:DataType="vm:MyProgramsViewModel"
  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 34" Text="Доступные программы" Classes="titleStyle" FontWeight="Bold"/>
  14. <ListBox Margin="0 0 0 34" ItemsSource="{Binding ProgramsWithSubject}">
  15. <ListBox.ItemTemplate>
  16. <DataTemplate>
  17. <StackPanel Orientation="Vertical">
  18. <TextBlock Margin="0 0 0 10" Text="{Binding Title}" Classes="mediumText" FontSize="24" FontWeight="Bold"/>
  19. <StackPanel Margin="0 0 0 34" Orientation="Horizontal">
  20. <TextBlock Margin="0 0 5 0" Text="Код программы: " Classes="mediumText"/>
  21. <TextBlock Text="{Binding Code}" Classes="mediumText"/>
  22. </StackPanel>
  23. <StackPanel Margin="0 0 0 10" Grid.Column="0" Orientation="Horizontal" HorizontalAlignment="Stretch">
  24. <TextBox Text="{Binding SearchQuery,Mode=TwoWay}" TextWrapping="NoWrap" Height="52" Watermark="Найдите нужный предмет" Width="600" HorizontalAlignment="Stretch"/>
  25. <Button Height="52" Width="52" Margin="0 0 23 0">
  26. <Image Source="/Assets/Images/searchIcon.png"/>
  27. </Button>
  28. </StackPanel>
  29. <ListBox ItemsSource="{Binding SubjectsList}">
  30. <ListBox.ItemTemplate>
  31. <DataTemplate>
  32. <Grid Margin="0 0 0 15">
  33. <Grid.ColumnDefinitions>
  34. <ColumnDefinition Width="3*"/>
  35. <ColumnDefinition Width="1*"/>
  36. </Grid.ColumnDefinitions>
  37. <TextBlock Grid.Column="0" Classes="mediumText" FontSize="24" VerticalAlignment="Center" HorizontalAlignment="Stretch" Text="{Binding IdSubjectNavigation.NameSubject}"/>
  38. <Button HorizontalAlignment="Stretch" Grid.Column="1" Content="Просмотреть информацию" VerticalAlignment="Center" Command="{Binding $parent[UserControl].((vm:MyProgramsViewModel)DataContext).GetCredit}" CommandParameter="{Binding IdSubject}"/>
  39. </Grid>
  40. </DataTemplate>
  41. </ListBox.ItemTemplate>
  42. </ListBox>
  43. </StackPanel>
  44. </DataTemplate>
  45. </ListBox.ItemTemplate>
  46. </ListBox>
  47. </StackPanel>
  48. </ScrollViewer>
  49. </UserControl>