Umgebaut auf Radiobuttons
This commit is contained in:
@@ -30,6 +30,7 @@ namespace KanSan
|
||||
UI.UCProjektList UCProjektList;
|
||||
UI.UCBaustelleList UCBaustelleList;
|
||||
|
||||
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
@@ -64,21 +65,7 @@ namespace KanSan
|
||||
ContentController.Content = UCKundeEdit;
|
||||
}
|
||||
|
||||
private void btnKunden_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ContentController.Content = UCKundeList;
|
||||
}
|
||||
|
||||
private void btnProjekte_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Kunde client = (DataContext as MainWindowViewModel).SelectedKunde;
|
||||
if (client == null) return;
|
||||
UCProjektList = new UI.UCProjektList(client);
|
||||
UCProjektList.ProjektSelected += UCProjektList_ProjektSelected;
|
||||
UCProjektList.ProjektAdded += UCProjektList_ProjektAdded;
|
||||
UCProjektList.ProjektEdited += UCProjektList_ProjektEdited;
|
||||
ContentController.Content = UCProjektList;
|
||||
}
|
||||
|
||||
|
||||
private void UCProjektList_ProjektEdited(object sender, UI.SelectProjektEventArgs e)
|
||||
{
|
||||
@@ -94,16 +81,6 @@ namespace KanSan
|
||||
ContentController.Content = "MainView";
|
||||
}
|
||||
|
||||
private void btnBaustellen_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Projekt projekt = (DataContext as MainWindowViewModel).SelectedProjekt;
|
||||
if (projekt == null) return;
|
||||
UCBaustelleList = new UI.UCBaustelleList(projekt);
|
||||
UCBaustelleList.BaustelleAdded += UCBaustelleList_BaustelleAdded;
|
||||
UCBaustelleList.BaustelleEdited += UCBaustelleList_BaustelleEdited;
|
||||
UCBaustelleList.BaustelleSelected += UCBaustelleList_BaustelleSelected;
|
||||
ContentController.Content = UCBaustelleList;
|
||||
}
|
||||
|
||||
private void UCBaustelleList_BaustelleSelected(object sender, UI.SelectBaustelleEventArgs e)
|
||||
{
|
||||
@@ -128,12 +105,6 @@ namespace KanSan
|
||||
ContentController.Content = uBaustelleEdit;
|
||||
}
|
||||
|
||||
private void btnObjekte_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
UI.UCObjekteList uCObjekteList = new UI.UCObjekteList((DataContext as MainWindowViewModel).SelectedBaustelle);
|
||||
uCObjekteList.ObjektSelected += UCObjekteList_ObjektSelected;
|
||||
ContentController.Content = uCObjekteList;
|
||||
}
|
||||
|
||||
private void UCObjekteList_ObjektSelected(object sender, UI.ObjektSelectEventArgs e)
|
||||
{
|
||||
@@ -143,6 +114,41 @@ namespace KanSan
|
||||
ContentController.Content = uCObjektEdit;
|
||||
//Debugger.Break();
|
||||
}
|
||||
|
||||
private void rbKunden_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
ContentController.Content = UCKundeList;
|
||||
}
|
||||
|
||||
private void rbProjekte_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Kunde client = (DataContext as MainWindowViewModel).SelectedKunde;
|
||||
if (client == null) return;
|
||||
UCProjektList = new UI.UCProjektList(client);
|
||||
UCProjektList.ProjektSelected += UCProjektList_ProjektSelected;
|
||||
UCProjektList.ProjektAdded += UCProjektList_ProjektAdded;
|
||||
UCProjektList.ProjektEdited += UCProjektList_ProjektEdited;
|
||||
ContentController.Content = UCProjektList;
|
||||
}
|
||||
|
||||
private void rbBaustellen_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
Projekt projekt = (DataContext as MainWindowViewModel).SelectedProjekt;
|
||||
if (projekt == null) return;
|
||||
UCBaustelleList = new UI.UCBaustelleList(projekt);
|
||||
UCBaustelleList.BaustelleAdded += UCBaustelleList_BaustelleAdded;
|
||||
UCBaustelleList.BaustelleEdited += UCBaustelleList_BaustelleEdited;
|
||||
UCBaustelleList.BaustelleSelected += UCBaustelleList_BaustelleSelected;
|
||||
ContentController.Content = UCBaustelleList;
|
||||
}
|
||||
|
||||
private void rbObjekte_Checked(object sender, RoutedEventArgs e)
|
||||
{
|
||||
rbObjekte.IsChecked = true;
|
||||
UI.UCObjekteList uCObjekteList = new UI.UCObjekteList((DataContext as MainWindowViewModel).SelectedBaustelle);
|
||||
uCObjekteList.ObjektSelected += UCObjekteList_ObjektSelected;
|
||||
ContentController.Content = uCObjekteList;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user