Schriftgröse geändert

Projekte können nun ausgewählt werden
This commit is contained in:
Husky
2020-02-26 14:54:27 +01:00
parent 9457784293
commit 5ba62ac16f
16 changed files with 302 additions and 16 deletions

View File

@@ -22,6 +22,15 @@ namespace KanSan.UI
/// </summary>
public partial class UCKundeEdit : UserControl
{
public event EventHandler SpeichernClicked;
protected virtual void OnSpeichernKlicked(EventArgs e)
{
EventHandler handler = SpeichernClicked;
if (handler != null)
handler(this, e);
}
//private Kunde kunde = null;
//private UnitOfWork unitOfWork = null;
public UCKundeEdit(Kunde kunde = null)
@@ -35,6 +44,7 @@ namespace KanSan.UI
private void Speichern_Click(object sender, RoutedEventArgs e)
{
((KundenEditViewModel)DataContext).Speichern();
OnSpeichernKlicked(EventArgs.Empty);
}
}

View File

@@ -0,0 +1,31 @@
<UserControl x:Class="KanSan.UI.UCProjektEdit"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:KanSan.UI"
xmlns:sd ="clr-namespace:KanSan.SampleData"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<d:UserControl.DataContext>
<sd:ProjektEditViewModelSampleData />
</d:UserControl.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Label Background="Beige" Grid.Column="0" Grid.Row="0" Content="Projektnummer" />
<Label Background="Beige" Grid.Column="0" Grid.Row="1" Content="Ort" />
<Button Grid.Row="2" Grid.ColumnSpan="2" Name="Speichern" Content="Speichern" Click="Speichern_Click" />
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding Projektnummer}" />
<TextBox Grid.Row="1" Grid.Column="1" Text="{Binding Ort}" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,44 @@
using KanSan.Base.Models;
using KanSan.ViewModel;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace KanSan.UI
{
/// <summary>
/// Interaktionslogik für UCProjektEdit.xaml
/// </summary>
public partial class UCProjektEdit : UserControl
{
public event EventHandler SpeichernClicked;
protected virtual void OnSpeichernKlicked(EventArgs e)
{
EventHandler handler = SpeichernClicked;
if (handler != null)
handler(this, e);
}
public UCProjektEdit(Projekt projekt)
{
InitializeComponent();
this.DataContext = new ProjektEditViewModel(projekt);
}
private void Speichern_Click(object sender, RoutedEventArgs e)
{
(DataContext as ProjektEditViewModel).Speichern();
OnSpeichernKlicked(EventArgs.Empty);
}
}
}

View File

@@ -4,8 +4,12 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:KanSan.UI"
xmlns:sd ="clr-namespace:KanSan.SampleData"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<d:UserControl.DataContext>
<sd:ProjektListViewModelSampleData />
</d:UserControl.DataContext>
<Grid>
<Grid.RowDefinitions>
<RowDefinition />
@@ -13,7 +17,12 @@
<RowDefinition Height="50" />
<RowDefinition Height="50" />
</Grid.RowDefinitions>
<DataGrid ItemsSource="{Binding Projekte}" Name="dgProjekte" />
<DataGrid ItemsSource="{Binding ProjekteVomKunde}" Name="dgProjekte" AutoGenerateColumns="False">
<DataGrid.Columns>
<DataGridTextColumn Header="Projektnummer" Binding="{Binding Projektnummer}" />
<DataGridTextColumn Header="Ort" Binding="{Binding Ort}" />
</DataGrid.Columns>
</DataGrid>
<Button Grid.Row="1" x:Name="ProjektSelect" Content="Projekt Auswählen" Click="ProjektSelect_Click" />
<Button Grid.Row="2" Name="ProjektEdit" Content="Projekt Editieren" Click="ProjektEdit_Click" />
<Button Grid.Row="3" Name="ProjektNew" Content="Neue Projekt Hinzufügen" Click="ProjektNew_Click" />