Navigation zwischen views Funktioniert

This commit is contained in:
HuskyTeufel
2021-09-14 20:37:33 +02:00
parent bbffb270bc
commit f6dd834f34
16 changed files with 210 additions and 98 deletions

View File

@@ -37,8 +37,11 @@ namespace DaSaSo.Wpf
services.AddSingleton<IViewModelAbstractFactory, ViewModelAbstractFactory>();
services.AddSingleton<IViewModelFactory<HomeViewModel>, HomeViewModelFactory>();
services.AddSingleton<IRenavigator, ViewModelFactoryRenavigator<ClientEditViewModel>>();
services.AddSingleton<IViewModelFactory<ClientListViewModel>, ClientListViewModelFactory>();
services.AddSingleton<IViewModelFactory<ClientEditViewModel>, ClientEditViewModelFactory>();
//services.AddSingleton<INavigator, Navigator>();
services.AddScoped<IActualProject, ActualProject>();
services.AddScoped<INavigator, Navigator>();

View File

@@ -14,9 +14,9 @@
<RowDefinition Height="auto" />
<RowDefinition Height="auto" />
</Grid.RowDefinitions>
<RadioButton Grid.Row="0" Content="Kunden" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateViewModelCommand}" CommandParameter="{x:Static nav:EViewType.Clients}" />
<RadioButton Grid.Row="1" Content="Projekte" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateViewModelCommand}" CommandParameter="{x:Static nav:EViewType.ClientEdit}" />
<RadioButton Grid.Row="2" Content="Baustellen" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateViewModelCommand}" CommandParameter="{x:Static nav:EViewType.Buildingsites}" />
<RadioButton Grid.Row="3" Content="Objekten" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateViewModelCommand}" CommandParameter="{x:Static nav:EViewType.SewerObjects}" />
<RadioButton Grid.Row="0" Content="Kunden" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" CommandParameter="{x:Static nav:EViewType.Clients}" />
<RadioButton Grid.Row="1" Content="Projekte" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" CommandParameter="{x:Static nav:EViewType.ClientEdit}" />
<RadioButton Grid.Row="2" Content="Baustellen" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" CommandParameter="{x:Static nav:EViewType.Buildingsites}" />
<RadioButton Grid.Row="3" Content="Objekten" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" CommandParameter="{x:Static nav:EViewType.SewerObjects}" />
</Grid>
</UserControl>

View File

@@ -14,7 +14,7 @@
<TextBlock Text="Kundenliste" />
<ListView ItemsSource="{Binding Clients}" DisplayMemberPath="Firstname" SelectedItem="{Binding SelectedClient, Mode=TwoWay}"/>
<Button Content="Kunde auswählen" Command="{Binding SelectCommand}" />
<Button Content="Kunde Editieren" Command="{Binding EditClientCommand}"/>
<Button Content="Kunde Editieren" Command="{Binding EditCommand}"/>
<Button Content="Kunde Hinzufügen" Command="{Binding AddNewClientCommand}" />
</StackPanel>
<Border Background="Gray" d:Visibility="Hidden" Visibility="{Binding IsLoading, Converter={StaticResource BooleanToVisibilityConverter}}">

View File

@@ -33,10 +33,10 @@
<RowDefinition />
<RowDefinition Height="20" />
</Grid.RowDefinitions>
<controls:NavigationBar Grid.Column="0" Grid.Row="0" DataContext="{Binding Navigator }" />
<controls:NavigationBar Grid.Column="0" Grid.Row="0"/>
<ContentControl Grid.Column="1" Grid.Row="0" Content="{Binding Navigator.CurrentViewModel}" />
<StatusBar Grid.Row="1" Grid.ColumnSpan="2">
<StatusBarItem Content="{Binding SelectedClient.Firstname}" />
<StatusBarItem Content="{Binding ClientName}" />
</StatusBar>
</Grid>
</Window>