Codepflege: CLAUDE.md und UI-Konsolidierung (Kapitel 13.4)
CLAUDE.md mit Projektkonventionen für künftige Claude-Code-Sitzungen. Wiederkehrende UI-Muster konsolidiert: neue PageHeader-Control für Titel/Untertitel in den Listen- und Detailansichten, globale Styles für Dialog-Titel und Leerlisten-Hinweise statt inline wiederholter Werte. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
CanResize="False" WindowStartupLocation="CenterOwner">
|
||||
<Grid RowDefinitions="*,Auto" Margin="24">
|
||||
<StackPanel Grid.Row="0" Spacing="12">
|
||||
<TextBlock Text="{Binding Title}" FontSize="18" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding Title}" Classes="dialogtitle"/>
|
||||
<TextBlock Text="{Binding Message}" TextWrapping="Wrap" Opacity="0.8"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Row="1" ColumnDefinitions="*,8,*" Margin="0,20,0,0">
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
<UserControl xmlns="https://github.com/avaloniaui"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
x:Class="LehrerApp.Desktop.Views.Shared.PageHeader"
|
||||
x:CompileBindings="False">
|
||||
<StackPanel>
|
||||
<TextBlock Text="{Binding Title, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
FontSize="22" FontWeight="SemiBold"/>
|
||||
<TextBlock Text="{Binding Subtitle, RelativeSource={RelativeSource AncestorType=UserControl}}"
|
||||
FontSize="12" Opacity="0.5"
|
||||
IsVisible="{Binding Subtitle, RelativeSource={RelativeSource AncestorType=UserControl},
|
||||
Converter={x:Static StringConverters.IsNotNullOrEmpty}}"/>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,29 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
|
||||
namespace LehrerApp.Desktop.Views.Shared;
|
||||
|
||||
/// Seiten-/Detail-Kopfzeile (Titel + optionaler Untertitel) — bisher in jeder
|
||||
/// Listen-/Detailansicht einzeln mit denselben Werten nachgebaut (13.4.3).
|
||||
public partial class PageHeader : UserControl
|
||||
{
|
||||
public static readonly StyledProperty<string> TitleProperty =
|
||||
AvaloniaProperty.Register<PageHeader, string>(nameof(Title), defaultValue: "");
|
||||
|
||||
public static readonly StyledProperty<string?> SubtitleProperty =
|
||||
AvaloniaProperty.Register<PageHeader, string?>(nameof(Subtitle));
|
||||
|
||||
public string Title
|
||||
{
|
||||
get => GetValue(TitleProperty);
|
||||
set => SetValue(TitleProperty, value);
|
||||
}
|
||||
|
||||
public string? Subtitle
|
||||
{
|
||||
get => GetValue(SubtitleProperty);
|
||||
set => SetValue(SubtitleProperty, value);
|
||||
}
|
||||
|
||||
public PageHeader() => InitializeComponent();
|
||||
}
|
||||
Reference in New Issue
Block a user