MOD: Frontend SearchWindow
This commit is contained in:
parent
3e9d887a12
commit
52b64e4430
@ -3,122 +3,149 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:local="clr-namespace:PrototypWPFHAG"
|
xmlns:local="clr-namespace:PrototypWPFHAG"
|
||||||
Title="PDF-Verwaltung (Admin)" Height="600" Width="1000"
|
Title="PDF-Verwaltung (Admin)"
|
||||||
|
Height="600" Width="1000"
|
||||||
|
MinWidth="800" MinHeight="500"
|
||||||
WindowTitleBrush="FireBrick"
|
WindowTitleBrush="FireBrick"
|
||||||
Icon="pack://application:,,,/Images/databaseicon.png"
|
Icon="pack://application:,,,/Images/databaseicon.png"
|
||||||
ResizeMode="CanResizeWithGrip">
|
ResizeMode="CanResizeWithGrip"
|
||||||
<!-- Gesamt‑Layout: Zwei Spalten – linke Seite (jetzt 600px) und rechte Seite (flexibel) -->
|
WindowStartupLocation="CenterScreen">
|
||||||
<Border BorderBrush="FireBrick" BorderThickness="3" Padding="0">
|
|
||||||
|
<Border BorderBrush="FireBrick" BorderThickness="3">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<!-- Breitere linke Seite: -->
|
<ColumnDefinition Width="500" MinWidth="400"/>
|
||||||
<ColumnDefinition Width="500"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
<Grid.RowDefinitions>
|
|
||||||
<RowDefinition Height="*"/>
|
|
||||||
</Grid.RowDefinitions>
|
|
||||||
|
|
||||||
<!-- Linke Seite -->
|
<!-- Linke Seite -->
|
||||||
<Border Grid.Column="0" Margin="10,10,0,10" Padding="20">
|
<Border Grid.Column="0" Margin="10" Padding="10">
|
||||||
<!-- Untergliederung: zwei Spalten (links: Upload/Steuerelemente, rechts: Suchergebnisse) -->
|
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
|
||||||
<ColumnDefinition Width="250"/>
|
|
||||||
<ColumnDefinition Width="*"/>
|
|
||||||
</Grid.ColumnDefinitions>
|
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<!-- Upload-/Such‑Steuerelemente in mehreren Zeilen -->
|
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<!-- Drag & Drop -->
|
<!-- Drag & Drop -->
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<!-- Upload-Button -->
|
<!-- Upload/Auswahl-Buttons -->
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<!-- RadioButtons für Suchmodus -->
|
<!-- Suchmodus -->
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<!-- Suchtext und Suchen-Button -->
|
<!-- Suchfeld -->
|
||||||
<RowDefinition Height="Auto"/>
|
|
||||||
<!-- Status & Progress -->
|
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
<!-- eventuell Füllraum -->
|
<!-- Suchergebnisse -->
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<!-- Status -->
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<!-- Zurück-Button -->
|
<!-- Zurück-Button -->
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<!-- Obere Zeile: Drag & Drop-Bereich -->
|
<!-- Drag & Drop Bereich -->
|
||||||
<Border Grid.ColumnSpan="2" Height="75" BorderBrush="Gray" BorderThickness="1">
|
<Border Grid.Row="0" Height="75" Margin="0,5"
|
||||||
|
BorderBrush="Gray" BorderThickness="1">
|
||||||
<Grid Background="Transparent" AllowDrop="True"
|
<Grid Background="Transparent" AllowDrop="True"
|
||||||
DragEnter="PdfDropCanvas_DragEnter" Drop="PdfDropCanvas_Drop" Margin="0,0,9,0">
|
DragEnter="PdfDropCanvas_DragEnter"
|
||||||
<!-- Hinweistext und ggf. Vorschau (zunächst unsichtbar) -->
|
Drop="PdfDropCanvas_Drop">
|
||||||
<Button Grid.Column="0" Content="Wähle PDF aus" Background="LightBlue" Click="ChoosePdfButton_Click"
|
|
||||||
Margin="296,-2,-15,0"/>
|
|
||||||
<TextBlock x:Name="DropHintText" Text="PDF hier rein ziehen"
|
<TextBlock x:Name="DropHintText" Text="PDF hier rein ziehen"
|
||||||
Foreground="Gray" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5"/>
|
VerticalAlignment="Center" HorizontalAlignment="Center"/>
|
||||||
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,30,0,0">
|
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
|
||||||
<Image x:Name="PdfIcon" Source="pack://application:,,,/Images/pdf-icon.png"
|
<Image x:Name="PdfIcon" Source="pack://application:,,,/Images/pdf-icon.png"
|
||||||
Width="25" Height="25" Visibility="Collapsed"/>
|
Width="25" Height="25" Visibility="Collapsed"/>
|
||||||
<TextBlock x:Name="PdfFileNameText" Margin="10,0,0,0" Visibility="Collapsed"/>
|
<TextBlock x:Name="PdfFileNameText" Margin="10"
|
||||||
|
TextWrapping="Wrap" Visibility="Collapsed"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Linke Spalte, 2. Zeile: PDF hochladen Button -->
|
<!-- Upload/Auswahl-Buttons -->
|
||||||
<Button Grid.Row="1" Grid.Column="0" Content="PDF hochladen"
|
<StackPanel Grid.Row="1" Orientation="Horizontal" Margin="0,10">
|
||||||
Width="235" Height="30" Background="LightGreen" Click="UploadButton_Click"
|
<Button Content="PDF hochladen"
|
||||||
Margin="0,10,0,0"/>
|
Width="210" Height="30"
|
||||||
|
Background="LightGreen"
|
||||||
|
Click="UploadButton_Click"/>
|
||||||
|
|
||||||
<!-- Linke Spalte, 3. Zeile: RadioButtons für Suchmodus -->
|
<Button Content="PDF auswählen"
|
||||||
<StackPanel Grid.Row="2" Grid.Column="0" Orientation="Horizontal" Margin="0,10,0,0">
|
Width="210" Height="30" Margin="40,0,0,0"
|
||||||
<RadioButton x:Name="SearchByIdRadio" Content="ID" IsChecked="True" Margin="0,0,10,0"/>
|
Background="Firebrick"
|
||||||
<RadioButton x:Name="SearchByTextRadio" Content="Text"/>
|
Click="ChoosePdfButton_Click"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Linke Spalte, 4. Zeile: Suchfeld und Suchbutton -->
|
<!-- Suchmodus-Auswahl -->
|
||||||
<StackPanel Grid.Row="3" Grid.Column="0" Orientation="Vertical" Margin="0,10,0,0">
|
<StackPanel Grid.Row="2" Orientation="Horizontal" Margin="0,10">
|
||||||
<TextBox x:Name="SearchTextBox" Width="232" />
|
<RadioButton x:Name="SearchByIdRadio"
|
||||||
<Button Content="Suchen" x:Name="SearchButton" Click="SearchButton_Click"
|
Content="ID"
|
||||||
Width="118" Margin="0,5,0,0"/>
|
Margin="5"
|
||||||
|
IsChecked="True"/>
|
||||||
|
<RadioButton x:Name="SearchByTextRadio"
|
||||||
|
Content="Text"
|
||||||
|
Margin="5"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Linke Spalte, 5. Zeile: Upload-Status und Fortschrittsanzeige -->
|
<!-- Suchfeld -->
|
||||||
<StackPanel Grid.Row="4" Grid.Column="0" Orientation="Vertical" Margin="0,10,0,0">
|
<StackPanel Grid.Row="3" Margin="0,10">
|
||||||
<TextBlock x:Name="UploadStatusText" TextAlignment="Center" Height="27"/>
|
<TextBox x:Name="SearchTextBox"
|
||||||
<ProgressBar x:Name="UploadProgressBar" Height="10" Minimum="0" Maximum="100"
|
Margin="0,0,0,5"
|
||||||
Visibility="Collapsed" Margin="0,5,0,0"/>
|
HorizontalAlignment="Stretch"/>
|
||||||
|
<Button Content="Suchen"
|
||||||
|
x:Name="SearchButton"
|
||||||
|
Height="30"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Click="SearchButton_Click"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<!-- Rechte Spalte: Suchergebnisse ListBox -->
|
<!-- Suchergebnisse -->
|
||||||
<ListBox Grid.Row="1" Grid.RowSpan="5" Grid.Column="1"
|
<ListBox Grid.Row="4"
|
||||||
x:Name="SearchResultsListBox" DisplayMemberPath="DocumentName"
|
x:Name="SearchResultsListBox"
|
||||||
ItemsSource="{Binding}" SelectionMode="Extended"
|
Margin="0,10"
|
||||||
SelectionChanged="SearchResultsListBox_SelectionChanged" Margin="10,10,0,0"/>
|
DisplayMemberPath="DocumentName"
|
||||||
|
ScrollViewer.VerticalScrollBarVisibility="Auto"
|
||||||
|
SelectionMode="Extended"
|
||||||
|
SelectionChanged="SearchResultsListBox_SelectionChanged"/>
|
||||||
|
|
||||||
<!-- Linke Spalte, untere Zeile: Button "Zurück zur Anmeldung" -->
|
<!-- Status & Fortschritt -->
|
||||||
<Button Grid.Row="6" Grid.Column="0" Content="Zurück zur Anmeldung"
|
<StackPanel Grid.Row="5" Orientation="Vertical" Margin="0,10">
|
||||||
Click="BackToLogIn_Click" Height="30" Background="#ffd64f" Margin="0,10,0,0"/>
|
<TextBlock x:Name="UploadStatusText" TextAlignment="Center"/>
|
||||||
|
<ProgressBar x:Name="UploadProgressBar"
|
||||||
|
Height="10"
|
||||||
|
Minimum="0"
|
||||||
|
Maximum="100"
|
||||||
|
Visibility="Collapsed"/>
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
|
<!-- Zurück-Button -->
|
||||||
|
<Button Grid.Row="6"
|
||||||
|
Content="Zurück zur Anmeldung"
|
||||||
|
Height="30" Margin="0,10"
|
||||||
|
HorizontalAlignment="Stretch"
|
||||||
|
Background="#ffd64f"
|
||||||
|
Click="BackToLogIn_Click"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<!-- Rechte Seite -->
|
<!-- Rechte Seite -->
|
||||||
<Border Grid.Column="1" Margin="43,10,10,10" Padding="10">
|
<Border Grid.Column="1" Margin="10">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<!-- Überschrift -->
|
|
||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
<!-- PDF-Inhalt -->
|
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<!-- Lösch-Button -->
|
|
||||||
</Grid.RowDefinitions>
|
</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 -->
|
<Label Content="PDF-Inhalt:" Margin="0,0,0,5"/>
|
||||||
<TextBox Grid.Row="1" x:Name="ContentTextBox"
|
|
||||||
Text="{Binding SelectedDocument.Content}"
|
<TextBox Grid.Row="1"
|
||||||
IsReadOnly="True" TextWrapping="Wrap" AcceptsReturn="True"
|
x:Name="ContentTextBox"
|
||||||
VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto"/>
|
TextWrapping="Wrap"
|
||||||
<Button Grid.Row="2" Content="Löschen" Width="100" Height="30"
|
AcceptsReturn="True"
|
||||||
Background="Firebrick" Click="DeleteButton_Click"
|
VerticalScrollBarVisibility="Auto"
|
||||||
HorizontalAlignment="Center" Margin="0,10,0,0"/>
|
HorizontalScrollBarVisibility="Auto"
|
||||||
|
IsReadOnly="True"/>
|
||||||
|
|
||||||
|
<Button Grid.Row="2"
|
||||||
|
Content="Löschen"
|
||||||
|
Width="100" Height="30"
|
||||||
|
Margin="0,10"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
Background="Firebrick"
|
||||||
|
Click="DeleteButton_Click"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user