AllPrograms.axaml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  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.AllPrograms"
  7. xmlns:vm="using:AvaloniaApplication4.ViewModels"
  8. x:DataType="vm:AllProgramsViewModel"
  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 Content="Добавить новую программу" Command="{Binding $parent[UserControl].((vm:AllProgramsViewModel)DataContext).AddProgram}" HorizontalAlignment="Stretch" Margin="0 0 0 23"/>
  15. <StackPanel IsVisible="{Binding IsVisibleFirst}" Orientation="Vertical" Margin="0 0 0 36" HorizontalAlignment="Stretch">
  16. <TextBlock FontWeight="Bold" Text="Запущенные программы" Margin="0 0 0 36"/>
  17. <StackPanel Margin="0 0 0 36" Orientation="Horizontal" HorizontalAlignment="Stretch">
  18. <TextBox Text="{Binding SearchProgramsRun, Mode=TwoWay}" Width="400" TextWrapping="NoWrap" Height="52" Watermark="Найдите нужную программу" HorizontalAlignment="Stretch"/>
  19. <Button Height="52" Width="52">
  20. <Image Source="/Assets/Images/searchIcon.png"/>
  21. </Button>
  22. </StackPanel>
  23. <ListBox ItemsSource="{Binding ProgramsRun}">
  24. <ListBox.ItemTemplate>
  25. <DataTemplate>
  26. <Grid Margin="0 0 0 15">
  27. <Grid.ColumnDefinitions>
  28. <ColumnDefinition Width="3*"/>
  29. <ColumnDefinition Width="1*"/>
  30. </Grid.ColumnDefinitions>
  31. <TextBlock Classes="mediumText" Text="{Binding IdProgramTemplateNavigation.NameProgram}" Grid.Column="0" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  32. <Button Content="Редактировать" Command="{Binding $parent[UserControl].((vm:AllProgramsViewModel)DataContext).EditAndAddProgram}" CommandParameter="{Binding IdRunningPrograms}" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  33. </Grid>
  34. </DataTemplate>
  35. </ListBox.ItemTemplate>
  36. </ListBox>
  37. </StackPanel>
  38. <StackPanel IsVisible="{Binding IsVisibleSecond}" Orientation="Vertical" HorizontalAlignment="Stretch">
  39. <TextBlock FontWeight="Bold" Text="Не запущенные программы" Margin="0 0 0 36"/>
  40. <StackPanel Margin="0 0 50 10" Orientation="Horizontal" HorizontalAlignment="Stretch">
  41. <TextBox Text="{Binding SearchProgramsNotRun, Mode=TwoWay}" Width="400" TextWrapping="NoWrap" Height="52" Watermark="Найдите нужную программу" HorizontalAlignment="Stretch"/>
  42. <Button Height="52" Width="52">
  43. <Image Source="/Assets/Images/searchIcon.png"/>
  44. </Button>
  45. </StackPanel>
  46. <ListBox ItemsSource="{Binding ProgramsNotRun}">
  47. <ListBox.ItemTemplate>
  48. <DataTemplate>
  49. <Grid Margin="0 0 0 15">
  50. <Grid.ColumnDefinitions>
  51. <ColumnDefinition Width="3*"/>
  52. <ColumnDefinition Width="1*"/>
  53. </Grid.ColumnDefinitions>
  54. <TextBlock Classes="mediumText" Text="{Binding IdProgramTemplateNavigation.NameProgram}" Grid.Column="0" TextWrapping="Wrap" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  55. <Button Content="Редактировать" Command="{Binding $parent[UserControl].((vm:AllProgramsViewModel)DataContext).EditAndAddProgram}" CommandParameter="{Binding IdRunningPrograms}" Grid.Column="1" VerticalAlignment="Center" HorizontalAlignment="Stretch"/>
  56. </Grid>
  57. </DataTemplate>
  58. </ListBox.ItemTemplate>
  59. </ListBox>
  60. </StackPanel>
  61. </StackPanel>
  62. </ScrollViewer>
  63. </UserControl>