This commit is contained in:
Husky
2020-07-15 17:18:52 +02:00
parent 3e9a353fc0
commit 7911a44f2f
23 changed files with 290 additions and 127 deletions

View File

@@ -36,52 +36,19 @@ namespace KanSan
UI.UCLeistungsverzeichnisPositionenBaustelle UCLeistungsverzeichnisPositionenBaustelle;
UI.UCLeistungsverzeichnisPosList UCLeistungsverzeichnisPosList;
public MainWindow()
public MainWindow(object dataContext)
{
InitializeComponent();
this.DataContext = new MainWindowViewModel();
(this.DataContext as MainWindowViewModel).GenerateExcelFile();
DataContext = dataContext;
//(this.DataContext as MainWindowViewModel).GenerateExcelFile();
#if DEBUG
System.Diagnostics.PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Critical;
#endif
}
private void UCProjektList_ProjektAdded(object sender, UI.SelectProjektEventArgs e)
{
if (e.projekt == null) return;
UI.UCProjektEdit uCProjektEdit = new UI.UCProjektEdit(e.projekt);
ContentController.Content = uCProjektEdit;
}
private void UCProjektList_ProjektSelected(object sender, UI.SelectProjektEventArgs e)
{
(DataContext as MainWindowViewModel).SelectedProjekt = e.projekt;
}
private void UCKundeList_KundeSelect(object sender, UI.KundeAddedKlickEventArgs e)
{
(DataContext as MainWindowViewModel).SelectedKunde = e.kunde;
}
private void UCKundeList_KundeAdded(object sender, UI.KundeAddedKlickEventArgs e)
{
UCKundeEdit = new UI.UCKundeEdit(e.kunde);
UCKundeEdit.SpeichernClicked += Edit_SpeichernClicked;
ContentController.Content = UCKundeEdit;
}
private void UCProjektList_ProjektEdited(object sender, UI.SelectProjektEventArgs e)
{
if (e.projekt == null) return;
UI.UCProjektEdit uCProjektEdit = new UI.UCProjektEdit(e.projekt);
uCProjektEdit.SpeichernClicked += Edit_SpeichernClicked;
ContentController.Content = uCProjektEdit;
}
private void Edit_SpeichernClicked(object sender, EventArgs e)
{
@@ -89,42 +56,6 @@ namespace KanSan
}
private void UCBaustelleList_BaustelleSelected(object sender, UI.SelectBaustelleEventArgs e)
{
(DataContext as MainWindowViewModel).SelectedBaustelle = e.baustelle;
}
private void UCBaustelleList_BaustelleEdited(object sender, UI.SelectBaustelleEventArgs e)
{
if (e.baustelle == null) return;
UI.UCBaustelleEdit uCBaustelleEdit = new UI.UCBaustelleEdit(e.baustelle);
uCBaustelleEdit.SpeichernClicked += Edit_SpeichernClicked;
ContentController.Content = uCBaustelleEdit;
}
private void UCBaustelleList_BaustelleAdded(object sender, UI.SelectBaustelleEventArgs e)
{
if (e.baustelle == null) return;
UI.UCBaustelleEdit uBaustelleEdit = new UI.UCBaustelleEdit(e.baustelle);
uBaustelleEdit.SpeichernClicked += Edit_SpeichernClicked;
ContentController.Content = uBaustelleEdit;
}
private void UCObjekteList_ObjektSelected(object sender, UI.ObjektSelectEventArgs e)
{
if (e.Objekt == null) return;
(DataContext as MainWindowViewModel).SelectedObjekt = e.Objekt;
rbObjekte.IsChecked = false;
uCSewerMainMenu = new UI.UCSewerMainMenu(e.Objekt);
ContentController.Content = uCSewerMainMenu;
}
private void rbLeistungsverzeichnis_Checked(object sender, RoutedEventArgs e)
{