SinglePage erweitert
This commit is contained in:
@@ -40,6 +40,7 @@ namespace DaSaSo.Wpf
|
||||
string connectionString = context.Configuration.GetConnectionString("default");
|
||||
|
||||
services.AddSingleton<DaSaSoDbContextFactory>(new DaSaSoDbContextFactory(connectionString));
|
||||
|
||||
services.AddSingleton<IDataService<Client>, ClientDataService>();
|
||||
services.AddSingleton<IDataService<Project>, ProjectDataService>();
|
||||
services.AddSingleton<IDataService<Buildingsite>, BuildingsiteDataService>();
|
||||
@@ -48,7 +49,7 @@ namespace DaSaSo.Wpf
|
||||
|
||||
|
||||
|
||||
services.AddSingleton<IViewModelAbstractFactory, ViewModelAbstractFactory>();
|
||||
services.AddSingleton<IViewModelAbstractFactory, MainWindowViewModelFactory>();
|
||||
services.AddSingleton<CreateViewModel<ClientEditViewModel>>(services =>
|
||||
{
|
||||
return () => new ClientEditViewModel(
|
||||
@@ -112,9 +113,12 @@ namespace DaSaSo.Wpf
|
||||
|
||||
|
||||
_host.Start();
|
||||
|
||||
|
||||
MainWindow? window = new MainWindow() { DataContext = _host.Services.GetRequiredService<MainWindowViewModel>() };
|
||||
window.Show();
|
||||
|
||||
|
||||
|
||||
base.OnStartup(e);
|
||||
}
|
||||
|
||||
|
||||
29
DaSaSo.Wpf/Controls/MainWindowNavigationBar.xaml
Normal file
29
DaSaSo.Wpf/Controls/MainWindowNavigationBar.xaml
Normal file
@@ -0,0 +1,29 @@
|
||||
<UserControl x:Class="DaSaSo.Wpf.Controls.MainWindowNavigationBar"
|
||||
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:DaSaSo.Wpf.Controls"
|
||||
xmlns:nav="clr-namespace:DaSaSo.ViewModel.Enums;assembly=DaSaSo.ViewModel"
|
||||
xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel"
|
||||
|
||||
xmlns:converters="clr-namespace:DaSaSo.Wpf.Converters"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<converters:EqualValueToParameterConverter x:Key="EqualValueToParameterConverter" />
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<RadioButton Grid.Row="0" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:ClientListViewModel}}" Content="Kunden" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="True" CommandParameter="{x:Static nav:EMainWindowViewType.Clients}"/>
|
||||
<RadioButton Grid.Row="1" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:ProjectListViewModel}}" Content="Projekte" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="{Binding CanSelectProject}" CommandParameter="{x:Static nav:EMainWindowViewType.Projects}" />
|
||||
<RadioButton Grid.Row="2" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:BuildingsiteListViewModel}}" Content="Baustellen" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="{Binding CanSelectBuildingSite}" CommandParameter="{x:Static nav:EMainWindowViewType.Buildingsites}" />
|
||||
<RadioButton Grid.Row="3" IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:SewerObjectListViewModel}}" Content="Objekten" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="{Binding CanSelectSewerObjects}" CommandParameter="{x:Static nav:EMainWindowViewType.SewerObjects}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -18,9 +18,9 @@ namespace DaSaSo.Wpf.Controls
|
||||
/// <summary>
|
||||
/// Interaction logic for NavigationBar.xaml
|
||||
/// </summary>
|
||||
public partial class NavigationBar : UserControl
|
||||
public partial class MainWindowNavigationBar : UserControl
|
||||
{
|
||||
public NavigationBar()
|
||||
public MainWindowNavigationBar()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
<UserControl x:Class="DaSaSo.Wpf.Controls.NavigationBar"
|
||||
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:DaSaSo.Wpf.Controls"
|
||||
xmlns:nav="clr-namespace:DaSaSo.ViewModel.Enums;assembly=DaSaSo.ViewModel" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<RadioButton Grid.Row="0" Content="Kunden" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="True" CommandParameter="{x:Static nav:EViewType.Clients}" />
|
||||
<RadioButton Grid.Row="1" Content="Projekte" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="{Binding CanSelectProject}" CommandParameter="{x:Static nav:EViewType.Projects}" />
|
||||
<RadioButton Grid.Row="2" Content="Baustellen" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="{Binding CanSelectBuildingSite}" CommandParameter="{x:Static nav:EViewType.Buildingsites}" />
|
||||
<RadioButton Grid.Row="3" Content="Objekten" Style="{StaticResource ToggleButtonList}" Command="{Binding UpdateCurrentViewModelCommand}" IsEnabled="{Binding CanSelectSewerObjects}" CommandParameter="{x:Static nav:EViewType.SewerObjects}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
16
DaSaSo.Wpf/Controls/SewerObjectNavigationBar.xaml
Normal file
16
DaSaSo.Wpf/Controls/SewerObjectNavigationBar.xaml
Normal file
@@ -0,0 +1,16 @@
|
||||
<UserControl x:Class="DaSaSo.Wpf.Controls.SewerObjectNavigationBar"
|
||||
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:DaSaSo.Wpf.Controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="200">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<RadioButton Content="Stammdaten" Style="{StaticResource ToggleButtonList}" Margin="20" />
|
||||
<RadioButton Content="Schäden" Style="{StaticResource ToggleButtonList}" Margin="20" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
DaSaSo.Wpf/Controls/SewerObjectNavigationBar.xaml.cs
Normal file
28
DaSaSo.Wpf/Controls/SewerObjectNavigationBar.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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 DaSaSo.Wpf.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for SewerObjectNavigationBar.xaml
|
||||
/// </summary>
|
||||
public partial class SewerObjectNavigationBar : UserControl
|
||||
{
|
||||
public SewerObjectNavigationBar()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
23
DaSaSo.Wpf/Converters/EqualValueToParameterConverter.cs
Normal file
23
DaSaSo.Wpf/Converters/EqualValueToParameterConverter.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace DaSaSo.Wpf.Converters
|
||||
{
|
||||
public class EqualValueToParameterConverter : IValueConverter
|
||||
{
|
||||
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
return value.ToString() == parameter.ToString();
|
||||
}
|
||||
|
||||
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -7,7 +7,10 @@
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Controls\NavigationBar.xaml.cs">
|
||||
<Compile Update="Controls\MainWindowNavigationBar.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Controls\SewerObjectNavigationBar.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\Buildingsites\BuildingSiteListView.xaml.cs">
|
||||
@@ -28,9 +31,15 @@
|
||||
<Compile Update="View\SewerObjecte\SewerObjecteListView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="View\SewerObject\SewerMainView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="Controls\NavigationBar.xaml">
|
||||
<Page Update="Controls\MainWindowNavigationBar.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Controls\SewerObjectNavigationBar.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="my_controls.xaml">
|
||||
@@ -57,6 +66,9 @@
|
||||
<Page Update="View\SewerObjecte\SewerObjecteListView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="View\SewerObject\SewerMainView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Window\MainWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
|
||||
15
DaSaSo.Wpf/Service/WindowService.cs
Normal file
15
DaSaSo.Wpf/Service/WindowService.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using DaSaSo.ViewModel.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace DaSaSo.Wpf.Service
|
||||
{
|
||||
class WindowService
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
24
DaSaSo.Wpf/View/SewerObject/SewerMainView.xaml
Normal file
24
DaSaSo.Wpf/View/SewerObject/SewerMainView.xaml
Normal file
@@ -0,0 +1,24 @@
|
||||
<UserControl x:Class="DaSaSo.Wpf.View.SewerObject.SewerMainView"
|
||||
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:DaSaSo.Wpf.View.SewerObject" xmlns:Controls="clr-namespace:DaSaSo.Wpf.Controls"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Controls:SewerObjectNavigationBar Grid.Column="0" />
|
||||
<ContentControl Grid.Column="1" />
|
||||
<StatusBar Grid.Row="1" Grid.ColumnSpan="2">
|
||||
<StatusBarItem Content="Dada" />
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
DaSaSo.Wpf/View/SewerObject/SewerMainView.xaml.cs
Normal file
28
DaSaSo.Wpf/View/SewerObject/SewerMainView.xaml.cs
Normal file
@@ -0,0 +1,28 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
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 DaSaSo.Wpf.View.SewerObject
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for SewerMainView.xaml
|
||||
/// </summary>
|
||||
public partial class SewerMainView : UserControl
|
||||
{
|
||||
public SewerMainView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -33,7 +33,7 @@
|
||||
</Style>
|
||||
</TreeView.Resources>
|
||||
</TreeView>
|
||||
<Button Content="Bearbeiten" Command="{Binding Bearbeiten}" />
|
||||
<Button Content="Bearbeiten" Name="bearbeiten" Command="{Binding Bearbeiten}" />
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
||||
@@ -1,17 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
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 DaSaSo.Wpf.View.SewerObjecte
|
||||
{
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
xmlns:View="clr-namespace:DaSaSo.Wpf.View"
|
||||
xmlns:local="clr-namespace:DaSaSo.Wpf" xmlns:viewmodel="clr-namespace:DaSaSo.ViewModel;assembly=DaSaSo.ViewModel" d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
|
||||
mc:Ignorable="d"
|
||||
Title="MainWindow" Height="450" Width="800">
|
||||
Title="Cosysda Sanierungs Software" Height="450" Width="800" WindowState="Maximized">
|
||||
<Window.Resources>
|
||||
<DataTemplate DataType="{x:Type viewmodel:ClientListViewModel}">
|
||||
<ClientViews:ClientListView />
|
||||
@@ -41,8 +41,8 @@
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="20" />
|
||||
</Grid.RowDefinitions>
|
||||
<controls:NavigationBar Grid.Column="0" Grid.Row="0"/>
|
||||
<ContentControl Grid.Column="1" Grid.Row="0" Content="{Binding Navigator.CurrentViewModel}" />
|
||||
<controls:MainWindowNavigationBar Grid.Column="0" Grid.Row="0"/>
|
||||
<ContentControl Grid.Column="1" Grid.Row="0" Content="{Binding CurrentViewModel}" />
|
||||
<StatusBar Grid.Row="1" Grid.ColumnSpan="2">
|
||||
<StatusBarItem Content="{Binding ClientName}" />
|
||||
<StatusBarItem Content="{Binding Projektname}" />
|
||||
|
||||
Reference in New Issue
Block a user