Data editing #77
+250
-64
@@ -3,100 +3,286 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" Icon="assets/icon.ico"
|
mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450" Icon="assets/icon.ico"
|
||||||
xmlns:local="using:Logof_Client"
|
xmlns:local="using:Logof_Client" Closing="Window_OnClosing"
|
||||||
x:Class="Logof_Client.PreviewWindow"
|
x:Class="Logof_Client.PreviewWindow"
|
||||||
Title="Datensätze bearbeiten" x:DataType="local:PreviewWindow">
|
Title="Datensätze bearbeiten" x:DataType="local:PreviewWindow">
|
||||||
<Grid Grid.ColumnDefinitions="*">
|
<Grid ColumnDefinitions="*,400"
|
||||||
<ScrollViewer Grid.Column="0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
|
Margin="10">
|
||||||
<DataGrid x:Name="AddressGrid"
|
|
||||||
ItemsSource="{Binding Addresses}"
|
|
||||||
AutoGenerateColumns="False"
|
|
||||||
IsReadOnly="False"
|
|
||||||
SelectionMode="Extended"
|
|
||||||
GridLinesVisibility="All">
|
|
||||||
|
|
||||||
<DataGrid.Columns>
|
<!-- Adressliste -->
|
||||||
|
<ListBox Grid.Column="0"
|
||||||
|
x:Name="AddressList"
|
||||||
|
ItemsSource="{Binding Addresses}"
|
||||||
|
SelectedItem="{Binding SelectedAddress}"
|
||||||
|
SelectionMode="Single">
|
||||||
|
|
||||||
<DataGridTextColumn Header="ID"
|
<ListBox.ItemsPanel>
|
||||||
Binding="{Binding id}"
|
<ItemsPanelTemplate>
|
||||||
IsReadOnly="True" />
|
<VirtualizingStackPanel />
|
||||||
|
</ItemsPanelTemplate>
|
||||||
|
</ListBox.ItemsPanel>
|
||||||
|
|
||||||
<DataGridTextColumn Header="RefSID"
|
<ListBox.ItemTemplate>
|
||||||
Binding="{Binding refsid}" />
|
<DataTemplate>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Anrede"
|
<Grid ColumnDefinitions="70,150,180,250,80,180,150"
|
||||||
Binding="{Binding anrede}" />
|
Height="32">
|
||||||
|
|
||||||
<DataGridTextColumn Header="Titel"
|
<TextBlock Grid.Column="0"
|
||||||
Binding="{Binding titel}" />
|
Text="{Binding id}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Vorname"
|
<TextBlock Grid.Column="1"
|
||||||
Binding="{Binding vorname}" />
|
Text="{Binding vorname}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Adel"
|
<TextBlock Grid.Column="2"
|
||||||
Binding="{Binding adel}" />
|
Text="{Binding name}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name"
|
<TextBlock Grid.Column="3"
|
||||||
Binding="{Binding name}" />
|
Text="{Binding strasse}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Namenszusatz"
|
<TextBlock Grid.Column="4"
|
||||||
Binding="{Binding namezus}" />
|
Text="{Binding plz}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Anredzusatz"
|
<TextBlock Grid.Column="5"
|
||||||
Binding="{Binding anredzus}" />
|
Text="{Binding ort}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Straße"
|
<TextBlock Grid.Column="6"
|
||||||
Binding="{Binding strasse}" />
|
Text="{Binding land}"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Straße 2"
|
</Grid>
|
||||||
Binding="{Binding strasse2}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="PLZ"
|
</DataTemplate>
|
||||||
Binding="{Binding plz}" />
|
</ListBox.ItemTemplate>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Ort"
|
</ListBox>
|
||||||
Binding="{Binding ort}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="Land"
|
|
||||||
Binding="{Binding land}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="PPLZ"
|
<!-- Editor -->
|
||||||
Binding="{Binding pplz}" />
|
<ScrollViewer Grid.Column="1"
|
||||||
|
Margin="15,0,0,0">
|
||||||
|
|
||||||
<DataGridTextColumn Header="Postfach"
|
<StackPanel Spacing="6">
|
||||||
Binding="{Binding postfach}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name 1"
|
<TextBlock Text="Adresse bearbeiten"
|
||||||
Binding="{Binding name1}" />
|
FontSize="20"
|
||||||
|
FontWeight="Bold"
|
||||||
|
Margin="0,0,0,10"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name 2"
|
|
||||||
Binding="{Binding name2}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name 3"
|
<Grid ColumnDefinitions="120,*"
|
||||||
Binding="{Binding name3}" />
|
RowDefinitions="Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto,Auto" RowSpacing="4">
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name 4"
|
<TextBlock Grid.Row="0"
|
||||||
Binding="{Binding name4}" />
|
Text="ID"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="0"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.id}"
|
||||||
|
IsReadOnly="True" IsEnabled="False"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Name 5"
|
|
||||||
Binding="{Binding name5}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="Funktion"
|
<TextBlock Grid.Row="1"
|
||||||
Binding="{Binding funktion}" />
|
Text="RefSID"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="1"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.refsid}"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Funktion 2"
|
|
||||||
Binding="{Binding funktion2}" />
|
|
||||||
|
|
||||||
<DataGridTextColumn Header="Abteilung"
|
<TextBlock Grid.Row="2"
|
||||||
Binding="{Binding abteilung}" />
|
Text="Anrede"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="2"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.anrede}"/>
|
||||||
|
|
||||||
<DataGridTextColumn Header="Funktion AD"
|
|
||||||
Binding="{Binding funktionad}" />
|
|
||||||
|
|
||||||
</DataGrid.Columns>
|
<TextBlock Grid.Row="3"
|
||||||
|
Text="Titel"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="3"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.titel}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="4"
|
||||||
|
Text="Vorname"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="4"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.vorname}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="5"
|
||||||
|
Text="Adel"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="5"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.adel}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="6"
|
||||||
|
Text="Name"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="6"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="7"
|
||||||
|
Text="Namenszusatz"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="7"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.namezus}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="8"
|
||||||
|
Text="Anredzusatz"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="8"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.anredzus}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="9"
|
||||||
|
Text="Straße"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="9"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.strasse}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="10"
|
||||||
|
Text="Straße 2"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="10"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.strasse2}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="11"
|
||||||
|
Text="PLZ"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="11"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.plz}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="12"
|
||||||
|
Text="Ort"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="12"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.ort}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="13"
|
||||||
|
Text="Land"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="13"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.land}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="14"
|
||||||
|
Text="PPLZ"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="14"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.pplz}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="15"
|
||||||
|
Text="Postfach"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="15"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.postfach}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="16"
|
||||||
|
Text="Name 1"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="16"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name1}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="17"
|
||||||
|
Text="Name 2"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="17"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name2}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="18"
|
||||||
|
Text="Name 3"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="18"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name3}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="19"
|
||||||
|
Text="Name 4"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="19"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name4}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="20"
|
||||||
|
Text="Name 5"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="20"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.name5}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="21"
|
||||||
|
Text="Funktion"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="21"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.funktion}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="22"
|
||||||
|
Text="Funktion 2"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="22"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.funktion2}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="23"
|
||||||
|
Text="Abteilung"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="23"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.abteilung}"/>
|
||||||
|
|
||||||
|
|
||||||
|
<TextBlock Grid.Row="24"
|
||||||
|
Text="Funktion AD"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBox Grid.Row="24"
|
||||||
|
Grid.Column="1"
|
||||||
|
Text="{Binding SelectedAddress.funktionad}"/>
|
||||||
|
|
||||||
|
</Grid>
|
||||||
|
|
||||||
|
</StackPanel>
|
||||||
|
|
||||||
</DataGrid>
|
|
||||||
<!-- <StackPanel x:Name="StkResults" Orientation="Vertical" Margin="10" /> -->
|
|
||||||
</ScrollViewer>
|
</ScrollViewer>
|
||||||
|
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
+22
-3
@@ -16,6 +16,23 @@ using System.Runtime.CompilerServices;
|
|||||||
|
|
||||||
public partial class PreviewWindow : Window, INotifyPropertyChanged
|
public partial class PreviewWindow : Window, INotifyPropertyChanged
|
||||||
{
|
{
|
||||||
|
public ObservableCollection<KasPerson> Addresses { get; }
|
||||||
|
|
||||||
|
private KasPerson? _selectedAddress;
|
||||||
|
|
||||||
|
public KasPerson? SelectedAddress
|
||||||
|
{
|
||||||
|
get => _selectedAddress;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
_selectedAddress = value;
|
||||||
|
PropertyChanged?.Invoke(
|
||||||
|
this,
|
||||||
|
new PropertyChangedEventArgs(nameof(SelectedAddress)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public event PropertyChangedEventHandler? PropertyChanged;
|
||||||
|
|
||||||
public PreviewWindow(IEnumerable<KasPerson> addresses)
|
public PreviewWindow(IEnumerable<KasPerson> addresses)
|
||||||
{
|
{
|
||||||
@@ -25,9 +42,11 @@ public partial class PreviewWindow : Window, INotifyPropertyChanged
|
|||||||
|
|
||||||
DataContext = this;
|
DataContext = this;
|
||||||
}
|
}
|
||||||
public ObservableCollection<KasPerson> Addresses { get; }
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
private void Window_OnClosing(object? sender, WindowClosingEventArgs e)
|
||||||
|
{
|
||||||
|
Settings.Save();
|
||||||
|
Global.Save();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user