Einstellungen zu den norm, wird design angezeigt

This commit is contained in:
2023-04-20 21:33:57 +02:00
parent bcbda7622c
commit 7fd87cff09
12 changed files with 227 additions and 13 deletions

View File

@@ -6,6 +6,7 @@ using System.Threading.Tasks;
namespace SewerStammGen.Shared.Enum
{
[Flags]
public enum EExportType
{
KANDIS4,
@@ -13,6 +14,8 @@ namespace SewerStammGen.Shared.Enum
M150,
XML2006,
XML2013,
XML2017
XML2017,
KANDIS = KANDIS4 | KANDIS6,
XML = XML2006 | XML2013 | XML2017
}
}

View File

@@ -0,0 +1,8 @@
namespace SewerStammGen.Shared.Enum
{
public enum ESelectedNorm
{
KANDIS,
XML
}
}

View File

@@ -0,0 +1,21 @@
using SewerStammGen.Shared.Enum;
using System;
using System.Globalization;
using System.Windows.Data;
namespace StammGenerator.Converters
{
public class ValueToExportConverter: 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)
{
return (EExportType)parameter;
}
}
}

View File

@@ -9,7 +9,7 @@
xmlns:view="clr-namespace:StammGenerator.Views"
xmlns:viewmodel="clr-namespace:StammGenerator.ViewModel"
FontSize="18"
Title="MainWindow" Height="450" Width="800">
<Window.Resources>
<DataTemplate DataType="{x:Type viewmodel:HomeViewModel}">

View File

@@ -7,10 +7,6 @@
<UseWPF>true</UseWPF>
</PropertyGroup>
<ItemGroup>
<Folder Include="ViewModel\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />

View File

@@ -19,6 +19,9 @@
<Compile Update="Views\MainWindowNavigationBar.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\Projekt\ProjektSettings.xaml.cs">
<SubType>Code</SubType>
</Compile>
<Compile Update="Views\Projekt\ProjektEditView.xaml.cs">
<SubType>Code</SubType>
</Compile>
@@ -51,6 +54,9 @@
<Page Update="Views\MainWindowNavigationBar.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\Projekt\ProjektSettings.xaml">
<SubType>Designer</SubType>
</Page>
<Page Update="Views\Projekt\ProjektEditView.xaml">
<SubType>Designer</SubType>
</Page>

View File

@@ -12,6 +12,8 @@ namespace StammGenerator.ViewModel
private readonly IDataService<Projekt> _dataService;
private readonly IRenavigator _renavigator;
public ProjektSettingsViewModel ProjektSettingsViewModel { get; set; }
public ICommand Speichern { get; set; }
public string ProjektName
{
@@ -71,6 +73,7 @@ namespace StammGenerator.ViewModel
_model = new Projekt();
Speichern = new RelayCommand((x) => this.SaveProject());
this.ProjektSettingsViewModel = new ProjektSettingsViewModel();
LoadProjekt();
}

View File

@@ -0,0 +1,77 @@
using SewerStammGen.Shared.Enum;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace StammGenerator.ViewModel
{
public class ProjektSettingsViewModel : BaseViewModel
{
private EExportType _selectedNorm;
private Visibility _xmlVisible;
private Visibility _kandisVisible;
public EExportType SelectedNorm
{
get => _selectedNorm;
set
{
if(value != _selectedNorm)
{
_selectedNorm = value;
if (_selectedNorm == EExportType.KANDIS)
{
KandisVisible = Visibility.Visible;
XmlVisible = Visibility.Collapsed;
}
else if(_selectedNorm == EExportType.XML)
{
XmlVisible = Visibility.Visible;
KandisVisible = Visibility.Collapsed;
}
OnPropertyChanged();
}
}
}
public Visibility XmlVisible
{
get => _xmlVisible;
set
{
if(_xmlVisible != value)
{
_xmlVisible = value;
OnPropertyChanged();
}
}
}
public Visibility KandisVisible
{
get => _kandisVisible;
set
{
if(_kandisVisible != value)
{
_kandisVisible = value;
OnPropertyChanged();
}
}
}
public ProjektSettingsViewModel()
{
SelectedNorm = EExportType.XML;
}
}
}

View File

@@ -4,11 +4,18 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:StammGenerator.Views"
xmlns:viewmodel="clr-namespace:StammGenerator.ViewModel"
mc:Ignorable="d"
d:DesignHeight="450" d:DesignWidth="800">
<UserControl.Resources>
<DataTemplate DataType="{x:Type viewmodel:ProjektSettingsViewModel}">
<local:ProjektSettings />
</DataTemplate>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition />
<ColumnDefinition Width="auto" />
<ColumnDefinition Width="300" />
<ColumnDefinition />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
@@ -31,5 +38,8 @@
<TextBox Grid.Column="1" Grid.Row="3" Text="{Binding Ort}" />
<Button Grid.ColumnSpan="2" Grid.Row="4" Content="Speichern" Command="{Binding Speichern}" />
<ContentPresenter Grid.Column="3" Grid.RowSpan="6" Content="{Binding ProjektSettingsViewModel}" />
</Grid>
</UserControl>

View File

@@ -0,0 +1,68 @@
<UserControl x:Class="StammGenerator.Views.ProjektSettings"
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:viewmodel="clr-namespace:StammGenerator.ViewModel"
xmlns:stat="clr-namespace:SewerStammGen.Shared.Enum;assembly=SewerStammGen.Shared"
xmlns:converter="clr-namespace:StammGenerator.Converters"
xmlns:local="clr-namespace:StammGenerator.Views"
mc:Ignorable="d"
d:DesignHeight="1357.579" d:DesignWidth="820.842">
<d:UserControl.DataContext>
<viewmodel:ProjektSettingsViewModel SelectedNorm="XML"/>
</d:UserControl.DataContext>
<UserControl.Resources>
<converter:ValueToExportConverter x:Key="EqualValueToExportConverter" />
</UserControl.Resources>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto" />
<RowDefinition />
</Grid.RowDefinitions>
<Grid Grid.Row="0" Margin="20,20,20,20">
<StackPanel>
<RadioButton GroupName="MainNorm" x:Name="XML" Content="XML" IsChecked="{Binding SelectedNorm,Converter={StaticResource EqualValueToExportConverter}, ConverterParameter={x:Static stat:EExportType.XML}}" />
<RadioButton GroupName="MainNorm" x:Name="KANDIS" Content="KANDIS" IsChecked="{Binding SelectedNorm,Converter={StaticResource EqualValueToExportConverter}, ConverterParameter={x:Static stat:EExportType.KANDIS}}" />
</StackPanel>
</Grid>
<Grid Grid.Row="1" Margin="20" Visibility="{Binding KandisVisible}">
<!-- KANDIS -->
<StackPanel>
<RadioButton Content="KANDIS 4.0" />
<RadioButton Content="KANDIS 6.0" />
</StackPanel>
</Grid>
<Grid Grid.Row="1" Margin="20" Visibility="{Binding XmlVisible}">
<!-- XML-->
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<StackPanel Grid.Row="0">
<RadioButton GroupName="Norm">DIN - EN 13508 - 2: 2003 / Ohne nationale Festlegung</RadioButton>
<RadioButton GroupName="Norm">DIN - EN 13508 - 2: 2003 / Nationale Festlegung DWA M 149-2</RadioButton>
<RadioButton GroupName="Norm" IsEnabled="False">DIN - EN 13508 - 2: 2003 / andere nationale Festlegung (Bemerkung erforderlich)</RadioButton>
<RadioButton GroupName="Norm" IsEnabled="False">ISYBAU 2001</RadioButton>
<RadioButton GroupName="Norm" IsEnabled="False">ISYBAU 1996</RadioButton>
<RadioButton GroupName="Norm" IsEnabled="False">anderes Kodiersystem (Bemerkung erfolrderlich)</RadioButton>
<RadioButton GroupName="Norm">DIN - EN 13508 - 2: 2003 / Nationale Festlegung Arbeitshilfen Abwasser</RadioButton>
<RadioButton GroupName="Norm">DIN - EN 13508 - 2: 2011 / Ohne nationale Festlegung</RadioButton>
<RadioButton GroupName="Norm">DIN - EN 13508 - 2: 2011 / Nationale Festlegung DWA M 149 - 2</RadioButton>
<RadioButton GroupName="Norm">DIN - EN 13508 - 2: 2011 / Nationale Festlegung Arbeitshilfen Abwasser</RadioButton>
</StackPanel>
<StackPanel Grid.Row="1">
<RadioButton GroupName="Regelwerk" IsEnabled="False">Arbeitshilfen Abwasser (ISYBAU 1996/2001)</RadioButton>
<RadioButton GroupName="Regelwerk">Arbeitshilfen Abwasser (ISYBAU 2006)</RadioButton>
<RadioButton GroupName="Regelwerk" IsEnabled="False">Sonstige Festlegungen</RadioButton>
<RadioButton GroupName="Regelwerk" IsEnabled="False">keine Angaben</RadioButton>
<RadioButton GroupName="Regelwerk">Arbeitshilfen Abwasser (ISYBAU 2013)</RadioButton>
<RadioButton GroupName="Regelwerk">Arbeitshilfen Abwasser (ISYBAU 2017)</RadioButton>
</StackPanel>
</Grid>
</Grid>
</UserControl>

View 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 StammGenerator.Views
{
/// <summary>
/// Interaktionslogik für ProjektSettings.xaml
/// </summary>
public partial class ProjektSettings : UserControl
{
public ProjektSettings()
{
InitializeComponent();
}
}
}

View File

@@ -3,8 +3,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33502.453
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SewerStammGen.WPF", "SewerStammGen.WPF\SewerStammGen.WPF.csproj", "{7052AE7B-9E3C-4C04-9756-7488D21512C1}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SewerStammGen.Shared", "SewerStammGen.Shared\SewerStammGen.Shared.csproj", "{3A47BD31-36C2-45C4-9609-D0D9D92A993B}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SewerStammGen.DAL", "SewerStammGen.DAL\SewerStammGen.DAL.csproj", "{7D983D7C-84C2-4FD8-B2CE-B13529036CB5}"
@@ -23,10 +21,6 @@ Global
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{7052AE7B-9E3C-4C04-9756-7488D21512C1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7052AE7B-9E3C-4C04-9756-7488D21512C1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7052AE7B-9E3C-4C04-9756-7488D21512C1}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7052AE7B-9E3C-4C04-9756-7488D21512C1}.Release|Any CPU.Build.0 = Release|Any CPU
{3A47BD31-36C2-45C4-9609-D0D9D92A993B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{3A47BD31-36C2-45C4-9609-D0D9D92A993B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{3A47BD31-36C2-45C4-9609-D0D9D92A993B}.Release|Any CPU.ActiveCfg = Release|Any CPU