Umgebaut auf Radiobuttons
This commit is contained in:
@@ -24,15 +24,11 @@
|
||||
<RowDefinition Height="11*" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Grid.Column="0">
|
||||
<RadioButton Name="rbKunden" Content="Kunden" Style="{StaticResource ToggelButtonList}" />
|
||||
<RadioButton Name="rbProjekte" Content="Projekte" Style="{StaticResource ToggelButtonList}" />
|
||||
<RadioButton Name="rbBaustellen" Content="Baustellen" Style="{StaticResource ToggelButtonList}" />
|
||||
<RadioButton x:Name="rbObjekte" Content="Objekte" Style="{StaticResource ToggelButtonList}" />
|
||||
<!-- <Button Content="Kunden" Name="btnKunden" Click="btnKunden_Click" />
|
||||
<Button Content="Projekte" Name="btnProjekte" Click="btnProjekte_Click" />
|
||||
<Button Content="Baustellen" Name="btnBaustellen" Click="btnBaustellen_Click" />
|
||||
<Button Content="Objekte" Name="btnObjekte" Click="btnObjekte_Click" />
|
||||
-->
|
||||
<RadioButton Name="rbKunden" Content="Kunden" Style="{StaticResource ToggelButtonList}" Checked="rbKunden_Checked" />
|
||||
<RadioButton Name="rbProjekte" Content="Projekte" Style="{StaticResource ToggelButtonList}" Checked="rbProjekte_Checked" />
|
||||
<RadioButton Name="rbBaustellen" Content="Baustellen" Style="{StaticResource ToggelButtonList}" Checked="rbBaustellen_Checked" />
|
||||
<RadioButton x:Name="rbObjekte" Content="Objekte" Style="{StaticResource ToggelButtonList}" Checked="rbObjekte_Checked" />
|
||||
|
||||
</StackPanel>
|
||||
<ContentControl Grid.Column="1" Name="ContentController" Content="KanSan"/>
|
||||
<StatusBar Grid.ColumnSpan="2" Margin="0,1,0,0" Grid.Row="1">
|
||||
|
||||
@@ -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