1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283 |
- <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="1000" d:DesignHeight="990"
- xmlns:vm="using:AvaloniaApplication4.ViewModels"
- x:DataType="vm:EditAndAddProgramViewModel"
- Background="White"
- Padding="80"
- x:Class="AvaloniaApplication4.Views.ActionPages.EditAndAddProgram">
- <ScrollViewer>
- <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0 20 0 0">
- <TextBlock Text="Программы" Classes="titleStyle" FontWeight="Bold" Margin="0 0 0 36"/>
- <TextBlock Text="Наименование программы" Classes="litleText" FontWeight="Bold" FontSize="24" Margin="0 0 0 20"/>
- <ComboBox HorizontalAlignment="Stretch" Margin="0 0 0 20" ItemsSource="{Binding ProgramTemplates}" SelectedIndex="{Binding IdRunningProgramTemplate, Mode=TwoWay}">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Vertical">
- <TextBlock FontSize="16" Text="{Binding NameProgram}"/>
- <TextBlock FontSize="14" Text="{Binding CodeProgram}"/>
- </StackPanel>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <TextBlock Text="Модули программы" Classes="litleText" FontWeight="Bold" FontSize="24" Margin="0 0 0 24"/>
- <Button Content="Добавить модуль" Command="{Binding $parent[UserControl].((vm:EditAndAddProgramViewModel)DataContext).AddNewModule}" HorizontalAlignment="Stretch" Margin="0 0 0 24"/>
- <ListBox Margin="0 0 0 20" ItemsSource="{Binding BindingsModules}">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="3*"/>
- <ColumnDefinition Width="1*"/>
- </Grid.ColumnDefinitions>
- <ComboBox ItemsSource="{Binding AllModules}" SelectedItem="{Binding Module, Mode=TwoWay}" Grid.Column="0" FontSize="16" HorizontalAlignment="Stretch" Margin="0 0 10 0">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <StackPanel Orientation="Vertical">
- <TextBlock Text="{Binding Name}"/>
- </StackPanel>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <Button Content="Удалить" Command="{Binding $parent[UserControl].((vm:EditAndAddProgramViewModel)DataContext).DeleteOneModule}" CommandParameter="{Binding Id}" Grid.Column="1" HorizontalAlignment="Stretch" Margin="10 0 0 0"/>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- <TextBlock Text="Предметы программы" Classes="litleText" FontWeight="Bold" FontSize="24" Margin="0 0 0 24"/>
- <Button Content="Добавить предмет" Command="{Binding $parent[UserControl].((vm:EditAndAddProgramViewModel)DataContext).AddNewSubject}" HorizontalAlignment="Stretch" Margin="0 0 0 24"/>
- <ListBox ItemsSource="{Binding BindingSubjects1}" Margin="0 0 0 40">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="3*"/>
- <ColumnDefinition Width="1*"/>
- </Grid.ColumnDefinitions>
- <ComboBox ItemsSource="{Binding AllSubjects}" SelectedItem="{Binding Subject}" Grid.Column="0" FontSize="16" HorizontalAlignment="Stretch" Margin="0 0 10 0">
- <ComboBox.ItemTemplate>
- <DataTemplate>
- <TextBlock Text="{Binding NameSubject}"/>
- </DataTemplate>
- </ComboBox.ItemTemplate>
- </ComboBox>
- <Button Content="Удалить" Command="{Binding $parent[UserControl].((vm:EditAndAddProgramViewModel)DataContext).DeleteOneSubject}" CommandParameter="{Binding Id}" Grid.Column="1" HorizontalAlignment="Stretch" Margin="10 0 0 0"/>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- <Button Content="{Binding BtnContent}" HorizontalAlignment="Stretch" Margin="0 0 0 40"/>
- <Grid Margin="0 0 0 40">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="1*"/>
- <ColumnDefinition Width="1*"/>
- </Grid.ColumnDefinitions>
- <Button HorizontalAlignment="Stretch" Grid.Column="0" Content="Сохранить" Margin="0 0 5 0"/>
- <Button HorizontalAlignment="Stretch" Grid.Column="1" Content="Удалить программу" Margin="5 0 0 0"/>
- </Grid>
- <Button Content="Вернуться назад" Command="{Binding $parent[UserControl].((vm:EditAndAddProgramViewModel)DataContext).GoBack}" HorizontalAlignment="Stretch"/>
- </StackPanel>
- </ScrollViewer>
- </UserControl>
|