Projekteinstellungen erweitert
This commit is contained in:
@@ -75,6 +75,7 @@ namespace StammGenerator.ViewModel
|
||||
Speichern = new RelayCommand((x) => this.SaveProject());
|
||||
this.ProjektSettingsViewModel = new ProjektSettingsViewModel();
|
||||
|
||||
|
||||
LoadProjekt();
|
||||
}
|
||||
|
||||
@@ -89,10 +90,13 @@ namespace StammGenerator.ViewModel
|
||||
Auftraggeber = new Auftraggeber(),
|
||||
};
|
||||
}
|
||||
|
||||
this.ProjektSettingsViewModel.Projekt = _model;
|
||||
OnPropertyChanged(nameof(ProjektName));
|
||||
OnPropertyChanged(nameof(Erstelldatum));
|
||||
OnPropertyChanged(nameof(Strasse));
|
||||
OnPropertyChanged(nameof(Ort));
|
||||
OnPropertyChanged(nameof(ProjektSettingsViewModel));
|
||||
}
|
||||
|
||||
private void SaveProject()
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using SewerStammGen.Shared.Enum;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.Shared.Enum;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
@@ -12,31 +13,60 @@ namespace StammGenerator.ViewModel
|
||||
|
||||
public class ProjektSettingsViewModel : BaseViewModel
|
||||
{
|
||||
private EExportType _selectedNorm;
|
||||
private Visibility _xmlVisible;
|
||||
private Visibility _kandisVisible;
|
||||
private ESelectedNorm _selectedNorm;
|
||||
private EKodierungssystem _selectedKodier;
|
||||
private Projekt _projekt = new Projekt();
|
||||
|
||||
public EExportType SelectedNorm
|
||||
|
||||
|
||||
public ESelectedNorm SelectedNorm
|
||||
{
|
||||
get => _selectedNorm;
|
||||
set
|
||||
{
|
||||
if(value != _selectedNorm)
|
||||
if(_selectedNorm != value)
|
||||
{
|
||||
_selectedNorm = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public EExportType SelectedExport
|
||||
{
|
||||
get => _projekt.ExportType;
|
||||
set
|
||||
{
|
||||
if(value != _projekt.ExportType)
|
||||
{
|
||||
_projekt.ExportType = value;
|
||||
|
||||
if (_selectedNorm == EExportType.KANDIS)
|
||||
if (_projekt.ExportType == EExportType.KANDIS)
|
||||
{
|
||||
KandisVisible = Visibility.Visible;
|
||||
XmlVisible = Visibility.Collapsed;
|
||||
}
|
||||
else if(_selectedNorm == EExportType.XML)
|
||||
else if(_projekt.ExportType == EExportType.XML)
|
||||
{
|
||||
XmlVisible = Visibility.Visible;
|
||||
KandisVisible = Visibility.Collapsed;
|
||||
}
|
||||
|
||||
OnPropertyChanged();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
public EKodierungssystem SelectedKodier
|
||||
{
|
||||
get => _selectedKodier;
|
||||
set
|
||||
{
|
||||
if(_selectedKodier != value)
|
||||
{
|
||||
_selectedKodier = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,11 +97,41 @@ namespace StammGenerator.ViewModel
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public Projekt Projekt
|
||||
{
|
||||
get => _projekt;
|
||||
set
|
||||
{
|
||||
if(value != _projekt)
|
||||
{
|
||||
_projekt = value;
|
||||
//SelectedExport = _projekt.ExportType;
|
||||
if(_projekt.ExportType == EExportType.KANDIS)
|
||||
{
|
||||
_kandisVisible = Visibility.Visible;
|
||||
_xmlVisible = Visibility.Collapsed;
|
||||
}
|
||||
else if(_projekt.ExportType == EExportType.XML)
|
||||
{
|
||||
_xmlVisible = Visibility.Visible;
|
||||
_kandisVisible = Visibility.Collapsed;
|
||||
}
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(SelectedNorm));
|
||||
OnPropertyChanged(nameof(SelectedExport));
|
||||
OnPropertyChanged(nameof(KandisVisible));
|
||||
OnPropertyChanged(nameof(XmlVisible));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ProjektSettingsViewModel()
|
||||
{
|
||||
SelectedNorm = EExportType.XML;
|
||||
|
||||
//SelectedExport = EExportType.XML;
|
||||
//this.Projekt = new Projekt();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user