fix: Aufsicht-Zeilen im Stundenplan deutlich schmaler als Stundenblöcke
UniformGrid erzwingt für alle Zellen dieselbe, vom größten Kind
bestimmte Höhe - eine Aufsicht-Zeile konnte dadurch nie schmaler
werden als eine Stundenzeile, auch nicht durch kleinere Inhalte.
Cells/WeekItems werden jetzt zusätzlich zeilenweise in neue
GridRows/WeekRows-Collections gruppiert (TimetableRowItem/
WeekRowItem, je eine eigene, ganz normal bindbare RowHeight -
Aufsicht-Zeilen 22px statt 46px/76px bei normalen Stunden-/
Kopfzeilen). Innerhalb jeder Zeile bleibt UniformGrid Columns="6"
für die Spaltenaufteilung. Grid.RowDefinitions ließ sich dafür nicht
per {Binding} setzen (Avalonia lehnt jede Bindungsform dafür mit
AVLN3000 ab) - deshalb dieser Umweg über echte Unterzeilen statt
eines einzelnen Grids mit dynamischer RowDefinitions-Bindung.
$parent[ItemsControl]-Bindings in den Zell-Templates mussten auf
$parent[ItemsControl;1] angepasst werden, da durch die neue
Verschachtelung sonst das innere Zeilen-ItemsControl statt des
äußeren (mit TimetableViewModel als DataContext) getroffen wird.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -442,6 +442,19 @@ public sealed class TimetableViewModelTests
|
||||
Assert.DoesNotContain(vm.Cells, c => c.IsSupervisionRow);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Load_AufsichtEingetragen_BekommtSchmalereZeilenhoeheAlsStundenzeilen()
|
||||
{
|
||||
var duties = new FakeSupervisionDuties();
|
||||
duties.Add(new SupervisionDuty { Weekday = DayOfWeek.Monday, AfterPeriod = 2, Location = "Pausenhof" });
|
||||
var vm = BuildViewModel(new FakeTimetableSlots(), new FakeGroups([]), supervisionDuties: duties);
|
||||
|
||||
var row = vm.GridRows.Single(r => r.Cells.Any(c => c.IsSupervisionRow && c.Text.Contains("n. 2.")));
|
||||
|
||||
Assert.Equal(22, row.RowHeight);
|
||||
Assert.Contains(vm.GridRows, r => r.RowHeight == 46); // normale Stundenzeilen bleiben unverändert
|
||||
}
|
||||
|
||||
// ── Aufsicht + Vertretung im Wochenraster ────────────────────────────────
|
||||
|
||||
[Fact]
|
||||
@@ -457,6 +470,19 @@ public sealed class TimetableViewModelTests
|
||||
Assert.False(mondayCell.IsSubstitutionSupervision);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Load_Wochenraster_AufsichtBekommtSchmalereZeilenhoeheAlsStundenzeilen()
|
||||
{
|
||||
var duties = new FakeSupervisionDuties();
|
||||
duties.Add(new SupervisionDuty { Weekday = DayOfWeek.Monday, AfterPeriod = 2, Location = "Pausenhof" });
|
||||
var vm = BuildViewModel(new FakeTimetableSlots(), new FakeGroups([]), supervisionDuties: duties);
|
||||
|
||||
var row = vm.WeekRows.Single(r => r.Cells.Any(c => c.IsSupervisionRow && c.Text.Contains("n. 2.")));
|
||||
|
||||
Assert.Equal(22, row.RowHeight);
|
||||
Assert.Contains(vm.WeekRows, r => r.RowHeight == 76);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void Load_Wochenraster_VertretungsaufsichtUeberschreibtRegulaereAnzeige()
|
||||
{
|
||||
|
||||
@@ -45,6 +45,7 @@ public partial class TimetableViewModel : ObservableObject
|
||||
{
|
||||
private const int FirstPeriod = 1;
|
||||
private const int LastPeriod = 10;
|
||||
private const int GridColumns = 6; // Label/Kopf-Spalte + 5 Wochentage (Mo-Fr)
|
||||
private static readonly DayOfWeek[] Weekdays =
|
||||
[DayOfWeek.Monday, DayOfWeek.Tuesday, DayOfWeek.Wednesday, DayOfWeek.Thursday, DayOfWeek.Friday];
|
||||
private static readonly string[] WeekdayColorPalette =
|
||||
@@ -70,6 +71,15 @@ public partial class TimetableViewModel : ObservableObject
|
||||
public ObservableCollection<TodaySpecialAssignmentItem> TodaySpecialAssignments { get; } = [];
|
||||
public ObservableCollection<UpcomingExamItem> UpcomingExams { get; } = [];
|
||||
|
||||
/// Cells/WeekItems zeilenweise gruppiert (GridColumns Zellen je Zeile), zusätzlich zur
|
||||
/// flachen Liste - Grundlage für die zeilenweise Höhensteuerung in der View (Aufsicht-Zeilen
|
||||
/// deutlich schmaler als Stunden-/Kopfzeilen). Grid.RowDefinitions lässt sich in Avalonia
|
||||
/// nicht per {Binding} setzen (Compiler lehnt jede Binding-Form dafür ab, siehe
|
||||
/// AVLN3000-Fehler „Unable to find suitable setter or adder for property RowDefinitions“) -
|
||||
/// deshalb hier stattdessen echte Unterzeilen mit je eigener, ganz normal bindbarer Height.
|
||||
public ObservableCollection<TimetableRowItem> GridRows { get; } = [];
|
||||
public ObservableCollection<WeekRowItem> WeekRows { get; } = [];
|
||||
|
||||
[ObservableProperty] private int _activeTabIndex;
|
||||
[ObservableProperty] private string _todayLabel = "";
|
||||
[ObservableProperty] private string _weekRangeLabel = "";
|
||||
@@ -325,6 +335,10 @@ public partial class TimetableViewModel : ObservableObject
|
||||
}
|
||||
AddWeekSupervisionRowIfAny(period, dutiesByPeriod, substitutionsThisWeek, dateByWeekday);
|
||||
}
|
||||
|
||||
WeekRows.Clear();
|
||||
foreach (var rowCells in WeekItems.Chunk(GridColumns))
|
||||
WeekRows.Add(new WeekRowItem(rowCells));
|
||||
}
|
||||
|
||||
private void AddWeekSupervisionRowIfAny(int afterPeriod, ILookup<int, SupervisionDuty> dutiesByPeriod,
|
||||
@@ -409,6 +423,10 @@ public partial class TimetableViewModel : ObservableObject
|
||||
}
|
||||
AddGridSupervisionRowIfAny(period, dutiesByPeriod);
|
||||
}
|
||||
|
||||
GridRows.Clear();
|
||||
foreach (var rowCells in Cells.Chunk(GridColumns))
|
||||
GridRows.Add(new TimetableRowItem(rowCells));
|
||||
}
|
||||
|
||||
/// <summary>Aufsicht wird nur in den Einstellungen gepflegt (siehe SettingsView) — im
|
||||
@@ -571,6 +589,18 @@ public class TimetableCellItem
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Eine Zeile im Bearbeiten-Raster (GridColumns Zellen). Aufsicht-Zeilen bekommen eine deutlich
|
||||
/// schmalere RowHeight als normale Kopf-/Stundenzeilen - eine echte, per Height ganz normal
|
||||
/// bindbare Eigenschaft je Unterzeile statt eines vollflächigen UniformGrid-Rasters, das allen
|
||||
/// Zeilen zwangsläufig dieselbe Höhe geben würde.
|
||||
/// </summary>
|
||||
public class TimetableRowItem(IReadOnlyList<TimetableCellItem> cells)
|
||||
{
|
||||
public IReadOnlyList<TimetableCellItem> Cells { get; } = cells;
|
||||
public double RowHeight { get; } = cells[0].IsSupervisionRow ? 22 : 46;
|
||||
}
|
||||
|
||||
/// <summary>Zelle im schreibgeschützten Wochenraster der "Heute"-Ansicht.</summary>
|
||||
public class WeekCellItem
|
||||
{
|
||||
@@ -671,6 +701,13 @@ public class WeekCellItem
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>Zeile im Wochenraster - siehe TimetableRowItem, dieselbe Rolle für WeekItems.</summary>
|
||||
public class WeekRowItem(IReadOnlyList<WeekCellItem> cells)
|
||||
{
|
||||
public IReadOnlyList<WeekCellItem> Cells { get; } = cells;
|
||||
public double RowHeight { get; } = cells[0].IsSupervisionRow ? 22 : 76;
|
||||
}
|
||||
|
||||
public class HoursWarningItem(string groupName, int assigned, int expected)
|
||||
{
|
||||
public string GroupName { get; } = groupName;
|
||||
|
||||
@@ -133,63 +133,77 @@
|
||||
ToolTip.Tip="Einstellungen (Ferien, Aufsichten, Stundenraster)"/>
|
||||
</Grid>
|
||||
|
||||
<ItemsControl ItemsSource="{Binding WeekItems}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate><UniformGrid Columns="6"/></ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<!-- Zeilenweise (WeekRows) statt eines einzigen flachen UniformGrid: so kann jede
|
||||
Zeile ihre eigene Höhe haben (RowHeight je WeekRowItem) - Aufsicht-Zeilen
|
||||
deutlich schmaler als Stunden-/Kopfzeilen. Grid.RowDefinitions lässt sich in
|
||||
Avalonia nicht per {Binding} setzen (AVLN3000 "Unable to find suitable setter
|
||||
or adder"), daher dieser Umweg statt eines einzelnen Grids mit dynamischer
|
||||
RowDefinitions-Bindung. Die innere UniformGrid Columns="6" bleibt unverändert
|
||||
für die Spaltenaufteilung innerhalb je einer Zeile. -->
|
||||
<ItemsControl ItemsSource="{Binding WeekRows}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:WeekCellItem">
|
||||
<Grid Margin="2" MinHeight="76">
|
||||
<Border Classes="weekheader" Classes.today="{Binding IsToday}" CornerRadius="4"
|
||||
IsVisible="{Binding IsHeader}">
|
||||
<TextBlock Text="{Binding Text}" FontWeight="SemiBold" FontSize="12" Opacity="0.75"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="4"/>
|
||||
</Border>
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsPeriodLabel}"
|
||||
FontWeight="SemiBold" FontSize="13"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsSupervisionRow}"
|
||||
FontSize="10" FontWeight="SemiBold" Opacity="0.55" TextWrapping="Wrap"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Border Classes="supervisioncell" Classes.substitution="{Binding IsSubstitutionSupervision}"
|
||||
CornerRadius="4" Padding="4" IsVisible="{Binding IsSupervisionCell}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<TextBlock Text="{Binding SupervisionLocation}" FontSize="10" Foreground="White"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap"
|
||||
IsVisible="{Binding HasSupervision}"/>
|
||||
</Border>
|
||||
<Border Classes="timetablecell" Classes.assigned="{Binding IsAssigned}"
|
||||
CornerRadius="6" IsVisible="{Binding IsSlotCell}">
|
||||
<Button Background="{Binding ColorHex}" IsVisible="{Binding IsAssigned}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch" CornerRadius="6" Padding="6"
|
||||
Command="{Binding $parent[ItemsControl].((vm:TimetableViewModel)DataContext).OpenGroupCommand}"
|
||||
CommandParameter="{Binding GroupId}">
|
||||
<StackPanel Spacing="1">
|
||||
<TextBlock FontSize="11" FontWeight="Bold" Foreground="White" TextWrapping="Wrap">
|
||||
<Run Text="{Binding SubjectLabel}"/><Run Text=" · "/><Run Text="{Binding GroupName}"/>
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding Room}" FontSize="10" Foreground="White" Opacity="0.9"
|
||||
IsVisible="{Binding HasRoom}"/>
|
||||
<TextBlock Text="{Binding Topic}" FontSize="10" Foreground="White" Opacity="0.8"
|
||||
TextWrapping="Wrap" IsVisible="{Binding HasTopic}"/>
|
||||
<TextBlock Text="Ferien" FontSize="10" Foreground="White" FontWeight="SemiBold"
|
||||
Opacity="0.9" IsVisible="{Binding IsHoliday}" Margin="0,2,0,0"/>
|
||||
<TextBlock Text="Ausfall" FontSize="10" Foreground="White" FontWeight="SemiBold"
|
||||
Opacity="0.9" IsVisible="{Binding IsCancelled}" Margin="0,2,0,0"/>
|
||||
<StackPanel Orientation="Horizontal" Spacing="3" Margin="0,2,0,0"
|
||||
IsVisible="{Binding !IsHoliday}">
|
||||
<Border Background="#B71C1C" CornerRadius="7" Padding="4,0" IsVisible="{Binding HasHolidayBadge}">
|
||||
<TextBlock Text="{Binding HolidayBadge}" FontSize="9" FontWeight="Bold" Foreground="White"/>
|
||||
</Border>
|
||||
<TextBlock Text="📝" FontSize="11" IsVisible="{Binding HasExam}" ToolTip.Tip="Klausur"/>
|
||||
<TextBlock Text="⏰" FontSize="11" IsVisible="{Binding IsLastBeforeExam}" ToolTip.Tip="Letzte Stunde vor der Klausur"/>
|
||||
<TextBlock Text="🧪" FontSize="11" IsVisible="{Binding HasExperiment}" ToolTip.Tip="Experiment geplant"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</Border>
|
||||
</Grid>
|
||||
<DataTemplate x:DataType="vm:WeekRowItem">
|
||||
<ItemsControl ItemsSource="{Binding Cells}" Height="{Binding RowHeight}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate><UniformGrid Columns="6"/></ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:WeekCellItem">
|
||||
<Grid Margin="2">
|
||||
<Border Classes="weekheader" Classes.today="{Binding IsToday}" CornerRadius="4"
|
||||
IsVisible="{Binding IsHeader}">
|
||||
<TextBlock Text="{Binding Text}" FontWeight="SemiBold" FontSize="12" Opacity="0.75"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" Margin="4"/>
|
||||
</Border>
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsPeriodLabel}"
|
||||
FontWeight="SemiBold" FontSize="13"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsSupervisionRow}"
|
||||
FontSize="10" FontWeight="SemiBold" Opacity="0.55" TextWrapping="Wrap"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Border Classes="supervisioncell" Classes.substitution="{Binding IsSubstitutionSupervision}"
|
||||
CornerRadius="4" Padding="4,1" IsVisible="{Binding IsSupervisionCell}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<TextBlock Text="{Binding SupervisionLocation}" FontSize="9" Foreground="White"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"
|
||||
IsVisible="{Binding HasSupervision}"/>
|
||||
</Border>
|
||||
<Border Classes="timetablecell" Classes.assigned="{Binding IsAssigned}"
|
||||
CornerRadius="6" IsVisible="{Binding IsSlotCell}">
|
||||
<Button Background="{Binding ColorHex}" IsVisible="{Binding IsAssigned}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Stretch" CornerRadius="6" Padding="6"
|
||||
Command="{Binding $parent[ItemsControl;1].((vm:TimetableViewModel)DataContext).OpenGroupCommand}"
|
||||
CommandParameter="{Binding GroupId}">
|
||||
<StackPanel Spacing="1">
|
||||
<TextBlock FontSize="11" FontWeight="Bold" Foreground="White" TextWrapping="Wrap">
|
||||
<Run Text="{Binding SubjectLabel}"/><Run Text=" · "/><Run Text="{Binding GroupName}"/>
|
||||
</TextBlock>
|
||||
<TextBlock Text="{Binding Room}" FontSize="10" Foreground="White" Opacity="0.9"
|
||||
IsVisible="{Binding HasRoom}"/>
|
||||
<TextBlock Text="{Binding Topic}" FontSize="10" Foreground="White" Opacity="0.8"
|
||||
TextWrapping="Wrap" IsVisible="{Binding HasTopic}"/>
|
||||
<TextBlock Text="Ferien" FontSize="10" Foreground="White" FontWeight="SemiBold"
|
||||
Opacity="0.9" IsVisible="{Binding IsHoliday}" Margin="0,2,0,0"/>
|
||||
<TextBlock Text="Ausfall" FontSize="10" Foreground="White" FontWeight="SemiBold"
|
||||
Opacity="0.9" IsVisible="{Binding IsCancelled}" Margin="0,2,0,0"/>
|
||||
<StackPanel Orientation="Horizontal" Spacing="3" Margin="0,2,0,0"
|
||||
IsVisible="{Binding !IsHoliday}">
|
||||
<Border Background="#B71C1C" CornerRadius="7" Padding="4,0" IsVisible="{Binding HasHolidayBadge}">
|
||||
<TextBlock Text="{Binding HolidayBadge}" FontSize="9" FontWeight="Bold" Foreground="White"/>
|
||||
</Border>
|
||||
<TextBlock Text="📝" FontSize="11" IsVisible="{Binding HasExam}" ToolTip.Tip="Klausur"/>
|
||||
<TextBlock Text="⏰" FontSize="11" IsVisible="{Binding IsLastBeforeExam}" ToolTip.Tip="Letzte Stunde vor der Klausur"/>
|
||||
<TextBlock Text="🧪" FontSize="11" IsVisible="{Binding HasExperiment}" ToolTip.Tip="Experiment geplant"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</Border>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
@@ -237,55 +251,65 @@
|
||||
<ContentPage Header="Bearbeiten">
|
||||
<ScrollViewer>
|
||||
<StackPanel Margin="32,20,32,28" Spacing="10">
|
||||
<ItemsControl ItemsSource="{Binding Cells}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate><UniformGrid Columns="6"/></ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<!-- Zeilenweise (GridRows) statt eines flachen UniformGrid, siehe Kommentar im
|
||||
Wochenraster oben (Heute-Tab) - gleicher Grund (Grid.RowDefinitions lässt sich
|
||||
nicht per {Binding} setzen). -->
|
||||
<ItemsControl ItemsSource="{Binding GridRows}">
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:TimetableCellItem">
|
||||
<Grid Margin="2" MinHeight="46">
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsHeader}"
|
||||
FontWeight="SemiBold" FontSize="12" Opacity="0.6"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsPeriodLabel}"
|
||||
FontWeight="SemiBold" FontSize="13"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsSupervisionRow}"
|
||||
FontSize="10" FontWeight="SemiBold" Opacity="0.55" TextWrapping="Wrap"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Border Classes="supervisioncell" CornerRadius="4" Padding="4"
|
||||
IsVisible="{Binding IsSupervisionCell}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<TextBlock Text="{Binding SupervisionLocation}" FontSize="10" Foreground="White"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center" TextWrapping="Wrap"
|
||||
IsVisible="{Binding HasSupervision}"/>
|
||||
</Border>
|
||||
<Border Classes="timetablecell" Classes.assigned="{Binding IsAssigned}"
|
||||
CornerRadius="6" IsVisible="{Binding IsSlotCell}">
|
||||
<Panel>
|
||||
<Button Background="{Binding ColorHex}"
|
||||
IsVisible="{Binding IsAssigned}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center" CornerRadius="6"
|
||||
Command="{Binding $parent[ItemsControl].((vm:TimetableViewModel)DataContext).EditCellCommand}"
|
||||
CommandParameter="{Binding}">
|
||||
<TextBlock Text="{Binding Text}" FontSize="11" Foreground="White"
|
||||
TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Button>
|
||||
<Button Content="+" Opacity="0.35"
|
||||
IsVisible="{Binding !IsAssigned}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center" Background="Transparent"
|
||||
Command="{Binding $parent[ItemsControl].((vm:TimetableViewModel)DataContext).EditCellCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
<Border Background="#D85A30" CornerRadius="8" Padding="5,1"
|
||||
IsVisible="{Binding HasBadge}"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="2">
|
||||
<TextBlock Text="{Binding BadgeText}" FontSize="10" FontWeight="Bold" Foreground="White"/>
|
||||
</Border>
|
||||
</Panel>
|
||||
</Border>
|
||||
</Grid>
|
||||
<DataTemplate x:DataType="vm:TimetableRowItem">
|
||||
<ItemsControl ItemsSource="{Binding Cells}" Height="{Binding RowHeight}">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate><UniformGrid Columns="6"/></ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
<ItemsControl.ItemTemplate>
|
||||
<DataTemplate x:DataType="vm:TimetableCellItem">
|
||||
<Grid Margin="2">
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsHeader}"
|
||||
FontWeight="SemiBold" FontSize="12" Opacity="0.6"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsPeriodLabel}"
|
||||
FontWeight="SemiBold" FontSize="13"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Text}" IsVisible="{Binding IsSupervisionRow}"
|
||||
FontSize="10" FontWeight="SemiBold" Opacity="0.55" TextWrapping="Wrap"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"/>
|
||||
<Border Classes="supervisioncell" CornerRadius="4" Padding="4,1"
|
||||
IsVisible="{Binding IsSupervisionCell}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
|
||||
<TextBlock Text="{Binding SupervisionLocation}" FontSize="9" Foreground="White"
|
||||
HorizontalAlignment="Center" VerticalAlignment="Center"
|
||||
TextWrapping="NoWrap" TextTrimming="CharacterEllipsis"
|
||||
IsVisible="{Binding HasSupervision}"/>
|
||||
</Border>
|
||||
<Border Classes="timetablecell" Classes.assigned="{Binding IsAssigned}"
|
||||
CornerRadius="6" IsVisible="{Binding IsSlotCell}">
|
||||
<Panel>
|
||||
<Button Background="{Binding ColorHex}"
|
||||
IsVisible="{Binding IsAssigned}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center" CornerRadius="6"
|
||||
Command="{Binding $parent[ItemsControl;1].((vm:TimetableViewModel)DataContext).EditCellCommand}"
|
||||
CommandParameter="{Binding}">
|
||||
<TextBlock Text="{Binding Text}" FontSize="11" Foreground="White"
|
||||
TextWrapping="Wrap" TextAlignment="Center"/>
|
||||
</Button>
|
||||
<Button Content="+" Opacity="0.35"
|
||||
IsVisible="{Binding !IsAssigned}"
|
||||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
|
||||
HorizontalContentAlignment="Center" Background="Transparent"
|
||||
Command="{Binding $parent[ItemsControl;1].((vm:TimetableViewModel)DataContext).EditCellCommand}"
|
||||
CommandParameter="{Binding}"/>
|
||||
<Border Background="#D85A30" CornerRadius="8" Padding="5,1"
|
||||
IsVisible="{Binding HasBadge}"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Top" Margin="2">
|
||||
<TextBlock Text="{Binding BadgeText}" FontSize="10" FontWeight="Bold" Foreground="White"/>
|
||||
</Border>
|
||||
</Panel>
|
||||
</Border>
|
||||
</Grid>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
</DataTemplate>
|
||||
</ItemsControl.ItemTemplate>
|
||||
</ItemsControl>
|
||||
|
||||
Reference in New Issue
Block a user