ProjektList angefangen
This commit is contained in:
@@ -91,14 +91,11 @@ namespace KanSan.ViewModel
|
|||||||
OnPropertyChanged();
|
OnPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private void SaveInRegistry(string key, string value)
|
private void SaveInRegistry(string key, string value)
|
||||||
{
|
{
|
||||||
Registry.SetValue(REGISTRYKEY, key, value);
|
Registry.SetValue(REGISTRYKEY, key, value);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void LadeRegistry()
|
private void LadeRegistry()
|
||||||
{
|
{
|
||||||
registry = Registry.CurrentUser.OpenSubKey("Software\\Cosysda\\KanSan");
|
registry = Registry.CurrentUser.OpenSubKey("Software\\Cosysda\\KanSan");
|
||||||
@@ -140,13 +137,11 @@ namespace KanSan.ViewModel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void InitRegistry()
|
private void InitRegistry()
|
||||||
{
|
{
|
||||||
Registry.CurrentUser.CreateSubKey("Software\\Cosysda\\KanSan");
|
Registry.CurrentUser.CreateSubKey("Software\\Cosysda\\KanSan");
|
||||||
LadeRegistry();
|
LadeRegistry();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MainWindowViewModel()
|
public MainWindowViewModel()
|
||||||
{
|
{
|
||||||
LadeRegistry();
|
LadeRegistry();
|
||||||
|
|||||||
@@ -1,4 +1,7 @@
|
|||||||
using System;
|
using KanSan.Base;
|
||||||
|
using KanSan.Base.Interfaces;
|
||||||
|
using KanSan.Base.Models;
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
|
|
||||||
@@ -6,5 +9,16 @@ namespace KanSan.ViewModel
|
|||||||
{
|
{
|
||||||
public class ProjektListViewModel
|
public class ProjektListViewModel
|
||||||
{
|
{
|
||||||
|
IUnitOfWork unitOfWork = new UnitOfWork(new KanSanContext());
|
||||||
|
|
||||||
|
public void SelectProjekt()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Projekt NeueProjekt()
|
||||||
|
{
|
||||||
|
throw new NotImplementedException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,9 @@
|
|||||||
<Compile Update="UI\Kunde\UCKundeEdit.xaml.cs">
|
<Compile Update="UI\Kunde\UCKundeEdit.xaml.cs">
|
||||||
<SubType>Code</SubType>
|
<SubType>Code</SubType>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Update="UI\Projekt\UCProjektList.xaml.cs">
|
||||||
|
<SubType>Code</SubType>
|
||||||
|
</Compile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Page Update="MainWindow.xaml">
|
<Page Update="MainWindow.xaml">
|
||||||
@@ -30,5 +33,8 @@
|
|||||||
<Page Update="UI\Kunde\UCKundeEdit.xaml">
|
<Page Update="UI\Kunde\UCKundeEdit.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Update="UI\Projekt\UCProjektList.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
</Page>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
</Project>
|
</Project>
|
||||||
21
KanSan/UI/Projekt/UCProjektList.xaml
Normal file
21
KanSan/UI/Projekt/UCProjektList.xaml
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
<UserControl x:Class="KanSan.UI.UCProjektList"
|
||||||
|
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"
|
||||||
|
mc:Ignorable="d"
|
||||||
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition />
|
||||||
|
<RowDefinition Height="50" />
|
||||||
|
<RowDefinition Height="50" />
|
||||||
|
<RowDefinition Height="50" />
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<DataGrid ItemsSource="{Binding Projekte}" Name="dgProjekte" />
|
||||||
|
<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" />
|
||||||
|
</Grid>
|
||||||
|
</UserControl>
|
||||||
79
KanSan/UI/Projekt/UCProjektList.xaml.cs
Normal file
79
KanSan/UI/Projekt/UCProjektList.xaml.cs
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
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 UCProjektList.xaml
|
||||||
|
/// </summary>
|
||||||
|
public partial class UCProjektList : UserControl
|
||||||
|
{
|
||||||
|
public event EventHandler<SelectProjektEventArgs> ProjektAdded;
|
||||||
|
public event EventHandler<SelectProjektEventArgs> ProjektEdited;
|
||||||
|
public event EventHandler<SelectProjektEventArgs> ProjektSelected;
|
||||||
|
public UCProjektList()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
this.DataContext = new ProjektListViewModel();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProjektSelect_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Projekt selectedProjekt = (dgProjekte.SelectedItem as Projekt);
|
||||||
|
if (selectedProjekt == null) return;
|
||||||
|
OnClickProjektSelect(new SelectProjektEventArgs() { projekt = selectedProjekt });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProjektEdit_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
Projekt selectedProjekt = (dgProjekte.SelectedItem as Projekt);
|
||||||
|
if (selectedProjekt == null) return;
|
||||||
|
OnClickProjektEdit(new SelectProjektEventArgs() { projekt = selectedProjekt });
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ProjektNew_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
OnClickProjektAdd(
|
||||||
|
new SelectProjektEventArgs()
|
||||||
|
{
|
||||||
|
projekt = (DataContext as ProjektListViewModel).NeueProjekt()
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected virtual void OnClickProjektSelect(SelectProjektEventArgs e)
|
||||||
|
{
|
||||||
|
EventHandler<SelectProjektEventArgs> handler = ProjektSelected;
|
||||||
|
if (handler != null)
|
||||||
|
handler(this, e);
|
||||||
|
}
|
||||||
|
protected virtual void OnClickProjektEdit(SelectProjektEventArgs e)
|
||||||
|
{
|
||||||
|
EventHandler<SelectProjektEventArgs> handler = ProjektEdited;
|
||||||
|
if (handler != null)
|
||||||
|
handler(this, e);
|
||||||
|
}
|
||||||
|
protected virtual void OnClickProjektAdd(SelectProjektEventArgs e)
|
||||||
|
{
|
||||||
|
EventHandler<SelectProjektEventArgs> handler = ProjektAdded;
|
||||||
|
if (handler != null)
|
||||||
|
handler(this, e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SelectProjektEventArgs : EventArgs
|
||||||
|
{
|
||||||
|
public Projekt projekt { get; set; }
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user