Bisher war die Einheit einer Stunde nach dem Anlegen fix - bei falscher Auswahl im Erstellen-Dialog blieb nur Löschen+Neuanlegen. Neuer Button öffnet einen Dialog zur Auswahl der Ziel-Einheit; die Ansicht springt danach automatisch dorthin mit der Stunde vorausgewählt. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
48 lines
2.2 KiB
XML
48 lines
2.2 KiB
XML
<Window xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:vm="clr-namespace:LehrerApp.Desktop.ViewModels.Groups"
|
|
xmlns:vmp="clr-namespace:LehrerApp.Desktop.ViewModels.Planning"
|
|
x:Class="LehrerApp.Desktop.Views.Groups.ChangeLessonUnitDialog"
|
|
x:DataType="vm:ChangeLessonUnitDialogViewModel"
|
|
Title="Einheit wechseln"
|
|
Width="440" Height="360" MinWidth="400" MinHeight="320"
|
|
CanResize="False" WindowStartupLocation="CenterOwner">
|
|
|
|
<Grid RowDefinitions="*,Auto" Margin="24">
|
|
<StackPanel Grid.Row="0" Spacing="14">
|
|
<TextBlock Text="Einheit wechseln" Classes="dialogtitle"/>
|
|
<TextBlock FontSize="12" Opacity="0.6">
|
|
<Run Text="Bisherige Einheit: "/>
|
|
<Run Text="{Binding CurrentUnitLabel}"/>
|
|
</TextBlock>
|
|
|
|
<StackPanel Spacing="5" IsVisible="{Binding HasUnits}">
|
|
<TextBlock Text="Neue Einheit" FontSize="12" Opacity="0.7"/>
|
|
<ComboBox ItemsSource="{Binding Units}" SelectedItem="{Binding SelectedUnit}"
|
|
HorizontalAlignment="Stretch">
|
|
<ComboBox.ItemTemplate>
|
|
<DataTemplate x:DataType="vmp:TimetableUnitOption">
|
|
<StackPanel>
|
|
<TextBlock Text="{Binding Label}" FontWeight="SemiBold"/>
|
|
<TextBlock Text="{Binding Detail}" FontSize="11" Opacity="0.6"/>
|
|
</StackPanel>
|
|
</DataTemplate>
|
|
</ComboBox.ItemTemplate>
|
|
</ComboBox>
|
|
</StackPanel>
|
|
|
|
<TextBlock Text="Keine andere Einheit in dieser Gruppe vorhanden."
|
|
FontSize="12" Opacity="0.7" TextWrapping="Wrap"
|
|
IsVisible="{Binding !HasUnits}"/>
|
|
|
|
<TextBlock Text="{Binding Error}" Foreground="Red" FontSize="11"
|
|
IsVisible="{Binding Error, Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
|
</StackPanel>
|
|
<Grid Grid.Row="1" ColumnDefinitions="*,8,*" Margin="0,20,0,0">
|
|
<Button Grid.Column="0" Content="Abbrechen" HorizontalAlignment="Stretch" Click="OnCancel"/>
|
|
<Button Grid.Column="2" Content="Verschieben" HorizontalAlignment="Stretch" Click="OnSave"
|
|
IsEnabled="{Binding HasUnits}"/>
|
|
</Grid>
|
|
</Grid>
|
|
</Window>
|