12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- <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="990" d:DesignHeight="1000"
- x:Class="AvaloniaApplication4.Views.ActionPages.EditAndAddModule"
- xmlns:vm="using:AvaloniaApplication4.ViewModels"
- x:DataType="vm:EditAndAddModuleViewModel"
- Background="White"
- Padding="80">
- <ScrollViewer>
- <StackPanel Orientation="Vertical" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="0 20 0 0">
- <TextBlock Margin="0 0 0 39" Text="Модули" Classes="titleStyle" FontWeight="Bold"/>
- <TextBox Text="{Binding Module.CodeModule}" Margin="0 0 0 22" Watermark="Код модуля"/>
- <TextBox Text="{Binding Module.Name}" Margin="0 0 0 22" Watermark="Наименование модуля"/>
- <TextBlock Text="Предметы модуля" Classes="litleText" FontWeight="Bold" FontSize="24" Margin="0 0 0 24"/>
- <Button Command="{Binding $parent[UserControl].((vm:EditAndAddModuleViewModel)DataContext).AddNewSubject}" Content="Добавить предмет" HorizontalAlignment="Stretch" Margin="0 0 0 24"/>
- <ListBox ItemsSource="{Binding MdkWithModulesBinding}" Margin="0 0 0 20">
- <ListBox.ItemTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="3*"/>
- <ColumnDefinition Width="1*"/>
- </Grid.ColumnDefinitions>
- <ComboBox ItemsSource="{Binding AllMDK}" SelectedItem="{Binding CurrentMDK, Mode=TwoWay}" 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:EditAndAddModuleViewModel)DataContext).DeleteCurrentSubject}" CommandParameter="{Binding Id}" Grid.Column="1" HorizontalAlignment="Stretch" Margin="10 0 0 0"/>
- </Grid>
- </DataTemplate>
- </ListBox.ItemTemplate>
- </ListBox>
- <Grid Margin="0 0 0 30">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="1*"/>
- <ColumnDefinition Width="1*"/>
- </Grid.ColumnDefinitions>
- <Button HorizontalAlignment="Stretch" Margin="5" Content="Сохранить модуль" Command="{Binding $parent[UserControl].((vm:EditAndAddModuleViewModel)DataContext).Save}" Grid.Column="0"/>
- <Button IsEnabled="{Binding IsNotNew}" HorizontalAlignment="Stretch" Command="{Binding $parent[UserControl].((vm:EditAndAddModuleViewModel)DataContext).Delete}" Margin="5" Content="Удалить модуль" Grid.Column="1"/>
- </Grid>
- <Button HorizontalAlignment="Stretch" Command="{Binding $parent[UserControl].((vm:EditAndAddModuleViewModel)DataContext).GoBack}" Content="Вернуться назад"/>
- </StackPanel>
- </ScrollViewer>
- </UserControl>
|