2025-04-09 10:00:17 +02:00
|
|
|
|
<mah:MetroWindow xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
2025-04-10 10:41:37 +02:00
|
|
|
|
x:Class="PrototypWPFHAG.SearchWindow"
|
|
|
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
|
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
|
|
|
xmlns:local="clr-namespace:PrototypWPFHAG"
|
|
|
|
|
Title="PDF-Verwaltung (Admin)" Height="600" Width="1000"
|
|
|
|
|
WindowTitleBrush="FireBrick"
|
|
|
|
|
Icon="pack://application:,,,/Images/databaseicon.png"
|
|
|
|
|
ResizeMode="CanResizeWithGrip">
|
|
|
|
|
<!-- Gesamt‑Layout: Zwei Spalten – linke Seite (jetzt 600px) und rechte Seite (flexibel) -->
|
|
|
|
|
<Border BorderBrush="FireBrick" BorderThickness="3" Padding="0">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<!-- Breitere linke Seite: -->
|
|
|
|
|
<ColumnDefinition Width="500"/>
|
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
<!-- Linke Seite -->
|
|
|
|
|
<Border Grid.Column="0" Margin="10,10,0,10" Padding="20">
|
|
|
|
|
<!-- Untergliederung: zwei Spalten (links: Upload/Steuerelemente, rechts: Suchergebnisse) -->
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.ColumnDefinitions>
|
|
|
|
|
<ColumnDefinition Width="250"/>
|
|
|
|
|
<ColumnDefinition Width="*"/>
|
|
|
|
|
</Grid.ColumnDefinitions>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<!-- Upload-/Such‑Steuerelemente in mehreren Zeilen -->
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<!-- Drag & Drop -->
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<!-- Upload-Button -->
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<!-- RadioButtons für Suchmodus -->
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<!-- Suchtext und Suchen-Button -->
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<!-- Status & Progress -->
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
<!-- eventuell Füllraum -->
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<!-- Zurück-Button -->
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
|
|
|
|
|
<!-- Obere Zeile: Drag & Drop-Bereich -->
|
|
|
|
|
<Border Grid.ColumnSpan="2" Height="75" BorderBrush="Gray" BorderThickness="1">
|
|
|
|
|
<Grid Background="Transparent" AllowDrop="True"
|
|
|
|
|
DragEnter="PdfDropCanvas_DragEnter" Drop="PdfDropCanvas_Drop" Margin="0,0,9,0">
|
|
|
|
|
<!-- Hinweistext und ggf. Vorschau (zunächst unsichtbar) -->
|
2025-04-10 11:22:48 +02:00
|
|
|
|
<Button Grid.Column="0" Content="Wähle PDF aus" Background="LightBlue" Click="ChoosePdfButton_Click"
|
|
|
|
|
Margin="296,-2,-15,0"/>
|
2025-04-10 10:41:37 +02:00
|
|
|
|
<TextBlock x:Name="DropHintText" Text="PDF hier rein ziehen"
|
|
|
|
|
Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5"/>
|
|
|
|
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,30,0,0">
|
|
|
|
|
<Image x:Name="PdfIcon" Source="pack://application:,,,/Images/pdf-icon.png"
|
|
|
|
|
Width="25" Height="25" Visibility="Collapsed"/>
|
|
|
|
|
<TextBlock x:Name="PdfFileNameText" Margin="10,0,0,0" Visibility="Collapsed"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
<!-- Linke Spalte, 2. Zeile: PDF hochladen Button -->
|
|
|
|
|
<Button Grid.Row="1" Grid.Column="0" Content="PDF hochladen"
|
|
|
|
|
Width="235" Height="30" Background="LightGreen" Click="UploadButton_Click"
|
|
|
|
|
Margin="0,10,0,0"/>
|
|
|
|
|
|
|
|
|
|
<!-- Linke Spalte, 3. Zeile: RadioButtons für Suchmodus -->
|
|
|
|
|
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" Margin="0,10,0,0">
|
|
|
|
|
<RadioButton x:Name="SearchByIdRadio" Content="ID" IsChecked="True" Margin="0,0,10,0"/>
|
|
|
|
|
<RadioButton x:Name="SearchByTextRadio" Content="Text"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
|
|
<!-- Linke Spalte, 4. Zeile: Suchfeld und Suchbutton -->
|
|
|
|
|
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Vertical" Margin="0,10,0,0">
|
|
|
|
|
<TextBox x:Name="SearchTextBox" Width="232" />
|
|
|
|
|
<Button Content="Suchen" x:Name="SearchButton" Click="SearchButton_Click"
|
|
|
|
|
Width="118" Margin="0,5,0,0"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
|
|
<!-- Linke Spalte, 5. Zeile: Upload-Status und Fortschrittsanzeige -->
|
|
|
|
|
<StackPanel Grid.Row="4" Grid.Column="0" Orientation="Vertical" Margin="0,10,0,0">
|
|
|
|
|
<TextBlock x:Name="UploadStatusText" TextAlignment="Center" Height="27"/>
|
|
|
|
|
<ProgressBar x:Name="UploadProgressBar" Height="10" Minimum="0" Maximum="100"
|
|
|
|
|
Visibility="Collapsed" Margin="0,5,0,0"/>
|
|
|
|
|
</StackPanel>
|
|
|
|
|
|
|
|
|
|
<!-- Rechte Spalte: Suchergebnisse ListBox -->
|
|
|
|
|
<ListBox Grid.Row="1" Grid.RowSpan="5" Grid.Column="1"
|
|
|
|
|
x:Name="SearchResultsListBox" DisplayMemberPath="DocumentName"
|
|
|
|
|
ItemsSource="{Binding}" SelectionMode="Extended"
|
|
|
|
|
SelectionChanged="SearchResultsListBox_SelectionChanged" Margin="10,10,0,0"/>
|
|
|
|
|
|
|
|
|
|
<!-- Linke Spalte, untere Zeile: Button "Zurück zur Anmeldung" -->
|
|
|
|
|
<Button Grid.Row="6" Grid.Column="0" Content="Zurück zur Anmeldung"
|
|
|
|
|
Click="BackToLogIn_Click" Height="30" Background="#ffd64f" Margin="0,10,0,0"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
|
|
|
|
|
|
|
|
|
<!-- Rechte Seite -->
|
|
|
|
|
<Border Grid.Column="1" Margin="43,10,10,10" Padding="10">
|
|
|
|
|
<Grid>
|
|
|
|
|
<Grid.RowDefinitions>
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<!-- Überschrift -->
|
|
|
|
|
<RowDefinition Height="*"/>
|
|
|
|
|
<!-- PDF-Inhalt -->
|
|
|
|
|
<RowDefinition Height="Auto"/>
|
|
|
|
|
<!-- Lösch-Button -->
|
|
|
|
|
</Grid.RowDefinitions>
|
|
|
|
|
<Label Grid.Row="0" Content="PDF-Inhalt:" Margin="0,0,0,5"/>
|
|
|
|
|
<!-- Für den Inhalt wird ein TextBox genutzt, der bei Bedarf automatisch Scrollbars anzeigt -->
|
|
|
|
|
<TextBox Grid.Row="1" x:Name="ContentTextBox"
|
|
|
|
|
Text="{Binding SelectedDocument.Content}"
|
|
|
|
|
IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True"
|
|
|
|
|
VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"/>
|
|
|
|
|
<Button Grid.Row="2" Content="Löschen" Width="100" Height="30"
|
|
|
|
|
Background="Firebrick" Click="DeleteButton_Click"
|
|
|
|
|
HorizontalAlignment="Center" Margin="0,10,0,0"/>
|
|
|
|
|
</Grid>
|
|
|
|
|
</Border>
|
2025-02-28 12:09:38 +01:00
|
|
|
|
</Grid>
|
2025-04-10 10:41:37 +02:00
|
|
|
|
</Border>
|
|
|
|
|
</mah:MetroWindow>
|