Verzeichnisse umgeräumt
This commit is contained in:
13
SewerStammGen.WPF/App.xaml
Normal file
13
SewerStammGen.WPF/App.xaml
Normal file
@@ -0,0 +1,13 @@
|
||||
<Application x:Class="SewerStammGen.WPF.App"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:local="clr-namespace:SewerStammGen"
|
||||
>
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="./Views/styles/my_controls.xaml" />
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
</Application>
|
||||
70
SewerStammGen.WPF/App.xaml.cs
Normal file
70
SewerStammGen.WPF/App.xaml.cs
Normal file
@@ -0,0 +1,70 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using SewerStammGen.HostBuilders;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.Data;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
||||
namespace SewerStammGen.WPF
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for App.xaml
|
||||
/// </summary>
|
||||
public partial class App : Application
|
||||
{
|
||||
private readonly IHost _host;
|
||||
public App()
|
||||
{
|
||||
_host = CreateHostBuilder().Build();
|
||||
}
|
||||
|
||||
static IHostBuilder CreateHostBuilder(string[]? args = null)
|
||||
{
|
||||
return Host.CreateDefaultBuilder(args)
|
||||
.AddConfiguration()
|
||||
.AddServices()
|
||||
.AddViewModels()
|
||||
.AddStores();
|
||||
|
||||
}
|
||||
|
||||
protected override void OnStartup(StartupEventArgs e)
|
||||
{
|
||||
Application.Current.DispatcherUnhandledException += Current_DispatcherUnhandledException;
|
||||
AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException;
|
||||
|
||||
_host.Start();
|
||||
|
||||
|
||||
|
||||
MainWindow? window = new MainWindow() { DataContext = _host.Services.GetRequiredService<MainWindowViewModel>() };
|
||||
window.Show();
|
||||
|
||||
base.OnStartup(e);
|
||||
}
|
||||
|
||||
private void CurrentDomain_UnhandledException(object sender, UnhandledExceptionEventArgs e)
|
||||
{
|
||||
try
|
||||
{
|
||||
Exception ex = (Exception)e.ExceptionObject;
|
||||
string text = "An application error occured. Plrease contact the Administrator with the following information:\n\n";
|
||||
MessageBox.Show(text + " " + ex.Message + "\n\n" + ex.StackTrace);
|
||||
}
|
||||
catch (Exception ex2)
|
||||
{
|
||||
MessageBox.Show("Fatal Non-UI error", ex2.Message, MessageBoxButton.OK, MessageBoxImage.Error);
|
||||
}
|
||||
}
|
||||
|
||||
private void Current_DispatcherUnhandledException(object sender, System.Windows.Threading.DispatcherUnhandledExceptionEventArgs e)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
10
SewerStammGen.WPF/AssemblyInfo.cs
Normal file
10
SewerStammGen.WPF/AssemblyInfo.cs
Normal file
@@ -0,0 +1,10 @@
|
||||
using System.Windows;
|
||||
|
||||
[assembly: ThemeInfo(
|
||||
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
|
||||
//(used if a resource is not found in the page,
|
||||
// or application resource dictionaries)
|
||||
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
|
||||
//(used if a resource is not found in the page,
|
||||
// app, or any theme specific resource dictionaries)
|
||||
)]
|
||||
45
SewerStammGen.WPF/Commands/AsyncCommandBase.cs
Normal file
45
SewerStammGen.WPF/Commands/AsyncCommandBase.cs
Normal file
@@ -0,0 +1,45 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
internal abstract class AsyncCommandBase : ICommand
|
||||
{
|
||||
bool _isExecuting = false;
|
||||
public event EventHandler? CanExecuteChanged;
|
||||
|
||||
public bool IsExecuting
|
||||
{
|
||||
get => _isExecuting;
|
||||
set
|
||||
{
|
||||
_isExecuting = value;
|
||||
CanExecuteChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
}
|
||||
|
||||
protected void OnCanExecuteChanged()
|
||||
{
|
||||
CanExecuteChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
|
||||
|
||||
public virtual bool CanExecute(object? parameter)
|
||||
{
|
||||
return !IsExecuting;
|
||||
}
|
||||
|
||||
public async void Execute(object? parameter)
|
||||
{
|
||||
IsExecuting = true;
|
||||
await ExecuteAsync(parameter);
|
||||
IsExecuting = false;
|
||||
}
|
||||
|
||||
public abstract Task ExecuteAsync(object? parameter);
|
||||
}
|
||||
}
|
||||
21
SewerStammGen.WPF/Commands/HaltungAddCommand.cs
Normal file
21
SewerStammGen.WPF/Commands/HaltungAddCommand.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
internal class HaltungAddCommand : AsyncCommandBase
|
||||
{
|
||||
public HaltungAddCommand()
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
public override Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
35
SewerStammGen.WPF/Commands/HaltungEditCommand.cs
Normal file
35
SewerStammGen.WPF/Commands/HaltungEditCommand.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
internal class HaltungEditCommand : AsyncCommandBase
|
||||
{
|
||||
|
||||
private IActualState actualState;
|
||||
private IRenavigator renavigator;
|
||||
private HaltungListViewModel haltungListViewModel;
|
||||
|
||||
|
||||
public HaltungEditCommand(IActualState actualState, IRenavigator renavigator, HaltungListViewModel haltungListViewModel)
|
||||
{
|
||||
|
||||
this.actualState = actualState;
|
||||
this.renavigator = renavigator;
|
||||
this.haltungListViewModel = haltungListViewModel;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
//actualState.SetHaltung(haltungListViewModel.SelectedHaltung);
|
||||
renavigator.Renavigate();
|
||||
}
|
||||
}
|
||||
}
|
||||
38
SewerStammGen.WPF/Commands/HaltungEditSaveCommand.cs
Normal file
38
SewerStammGen.WPF/Commands/HaltungEditSaveCommand.cs
Normal file
@@ -0,0 +1,38 @@
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using Shared.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
internal class HaltungEditSaveCommand : AsyncCommandBase
|
||||
{
|
||||
private HaltungEditViewModel haltungEditViewModel;
|
||||
private IDataService<Kanal> kanalDataService;
|
||||
|
||||
|
||||
public HaltungEditSaveCommand(HaltungEditViewModel haltungEditViewModel)
|
||||
{
|
||||
this.haltungEditViewModel = haltungEditViewModel;
|
||||
//this.kanalDataService = kanalDataService;
|
||||
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
if(haltungEditViewModel._oberePunkt != haltungEditViewModel.Model.StartSchacht.Objektbezeichnung)
|
||||
{
|
||||
//Schacht s = await schachtService.FindSchachtByNameAndProjektID(haltungEditViewModel._oberePunkt, haltungEditViewModel.Model.Projekt.Id);
|
||||
//haltungEditViewModel.Model.StartSchacht = s;
|
||||
}
|
||||
//haltungEditViewModel.Model = await kanalDataService.Update(haltungEditViewModel.Model.Id, haltungEditViewModel.Model);
|
||||
Trace.WriteLine("Daten gespeichert");
|
||||
}
|
||||
}
|
||||
}
|
||||
44
SewerStammGen.WPF/Commands/ProjektAddCommand.cs
Normal file
44
SewerStammGen.WPF/Commands/ProjektAddCommand.cs
Normal file
@@ -0,0 +1,44 @@
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using Shared.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
internal class ProjektAddCommand : AsyncCommandBase
|
||||
{
|
||||
private readonly IActualState _actualState;
|
||||
private readonly IDataService<Projekt> _generic;
|
||||
private readonly IRenavigator _renavigator;
|
||||
|
||||
public ProjektAddCommand(IDataService<Projekt> generic, IActualState actualState, IRenavigator renavigator)
|
||||
{
|
||||
_renavigator = renavigator;
|
||||
_generic = generic;
|
||||
_actualState = actualState;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
Projekt newProjekt = new Projekt()
|
||||
{
|
||||
Erstelldatum = "",
|
||||
Strasse = "",
|
||||
Ort = "",
|
||||
Projektname = "",
|
||||
Auftraggeber = new Auftraggeber(),
|
||||
Schaechte = new List<Schacht>(),
|
||||
Kanaele = new List<Kanal>()
|
||||
};
|
||||
//newProjekt = await _generic.Create(newProjekt);
|
||||
_actualState.SetProjekt(newProjekt);
|
||||
_renavigator.Renavigate();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
35
SewerStammGen.WPF/Commands/ProjektEditCommand.cs
Normal file
35
SewerStammGen.WPF/Commands/ProjektEditCommand.cs
Normal file
@@ -0,0 +1,35 @@
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using Shared.Contracts;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
internal class ProjektEditCommand : AsyncCommandBase
|
||||
{
|
||||
private IDataService<Projekt> _dataService;
|
||||
private IActualState _actualState;
|
||||
private IRenavigator _renavigator;
|
||||
private ProjektListViewModel _projektListViewModel;
|
||||
|
||||
|
||||
public ProjektEditCommand(IDataService<Projekt> dataService, IActualState actualState, IRenavigator renavigator, ProjektListViewModel projektListViewModel)
|
||||
{
|
||||
_dataService = dataService;
|
||||
_actualState = actualState;
|
||||
_renavigator = renavigator;
|
||||
_projektListViewModel = projektListViewModel;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
|
||||
_actualState.SetProjekt(_projektListViewModel.SelectedProjekt);
|
||||
_renavigator.Renavigate();
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
25
SewerStammGen.WPF/Commands/ProjektSelectCommand.cs
Normal file
25
SewerStammGen.WPF/Commands/ProjektSelectCommand.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using System;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
internal class ProjektSelectCommand : AsyncCommandBase
|
||||
{
|
||||
private readonly IActualState _actualState;
|
||||
private readonly ProjektListViewModel _projektListViewModel;
|
||||
|
||||
public ProjektSelectCommand(IActualState actualState, ProjektListViewModel projektListViewModel)
|
||||
{
|
||||
_actualState = actualState;
|
||||
_projektListViewModel = projektListViewModel;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
if (_projektListViewModel.SelectedProjekt == null) return;
|
||||
_actualState.SetProjekt(_projektListViewModel.SelectedProjekt);
|
||||
}
|
||||
}
|
||||
}
|
||||
36
SewerStammGen.WPF/Commands/SchachtAddCommand.cs
Normal file
36
SewerStammGen.WPF/Commands/SchachtAddCommand.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using Shared.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
class SchachtAddCommand : AsyncCommandBase
|
||||
{
|
||||
private readonly IActualState actualState;
|
||||
private readonly IRenavigator renavigator;
|
||||
private readonly IDataService<Projekt> projektService;
|
||||
|
||||
|
||||
public SchachtAddCommand(IDataService<Projekt> projektService, IActualState actualState, IRenavigator renavigator)
|
||||
{
|
||||
this.actualState = actualState;
|
||||
this.renavigator = renavigator;
|
||||
this.projektService = projektService;
|
||||
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
Projekt aktuelleProjekt = await projektService.Get(actualState.ProjektID);
|
||||
// Schacht schacht = await schachtService.CreateSchacht(aktuelleProjekt);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
33
SewerStammGen.WPF/Commands/SchachtDeleteCommand.cs
Normal file
33
SewerStammGen.WPF/Commands/SchachtDeleteCommand.cs
Normal file
@@ -0,0 +1,33 @@
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
class SchachtDeleteCommand : AsyncCommandBase
|
||||
{
|
||||
private ISchachtDataService schachtService;
|
||||
private IActualState actualState;
|
||||
private IRenavigator renavigator;
|
||||
private ManholeListViewModel manholeListViewModel;
|
||||
|
||||
public SchachtDeleteCommand(ISchachtDataService schachtService, IActualState actualState, IRenavigator renavigator, ManholeListViewModel manholeListViewModel)
|
||||
{
|
||||
this.schachtService = schachtService;
|
||||
this.actualState = actualState;
|
||||
this.renavigator = renavigator;
|
||||
this.manholeListViewModel = manholeListViewModel;
|
||||
}
|
||||
|
||||
public override Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
34
SewerStammGen.WPF/Commands/SchachtEditCommand.cs
Normal file
34
SewerStammGen.WPF/Commands/SchachtEditCommand.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
class SchachtEditCommand : AsyncCommandBase
|
||||
{
|
||||
private ISchachtDataService schachtService;
|
||||
private IActualState actualState;
|
||||
private IRenavigator renavigator;
|
||||
private ManholeListViewModel manholeListViewModel;
|
||||
|
||||
public SchachtEditCommand(ISchachtDataService schachtService, IActualState actualState, IRenavigator renavigator, ManholeListViewModel manholeListViewModel)
|
||||
{
|
||||
this.schachtService = schachtService;
|
||||
this.actualState = actualState;
|
||||
this.renavigator = renavigator;
|
||||
this.manholeListViewModel = manholeListViewModel;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
actualState.SetSchacht(manholeListViewModel.SelectedSchacht);
|
||||
renavigator.Renavigate();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
SewerStammGen.WPF/Commands/UpdateCurrentViewModelCommand.cs
Normal file
32
SewerStammGen.WPF/Commands/UpdateCurrentViewModelCommand.cs
Normal file
@@ -0,0 +1,32 @@
|
||||
using SewerStammGen.Enum;
|
||||
using SewerStammGen.WPF.Interface;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Commands
|
||||
{
|
||||
internal class UpdateCurrentViewModelCommand : AsyncCommandBase
|
||||
{
|
||||
private INavigator _navigator;
|
||||
private readonly IViewModelAbstractFactory _viewModelFactory;
|
||||
|
||||
public UpdateCurrentViewModelCommand(INavigator navigator, IViewModelAbstractFactory viewModelFactory)
|
||||
{
|
||||
_navigator = navigator;
|
||||
_viewModelFactory = viewModelFactory;
|
||||
}
|
||||
|
||||
public override async Task ExecuteAsync(object? parameter)
|
||||
{
|
||||
if(parameter is EMainWindowViewType)
|
||||
{
|
||||
EMainWindowViewType viewType = (EMainWindowViewType)parameter;
|
||||
_navigator.CurrentViewModel = _viewModelFactory.CreateViewModel(viewType);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
SewerStammGen.WPF/Enum/EMainWindowViewType.cs
Normal file
18
SewerStammGen.WPF/Enum/EMainWindowViewType.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.Enum
|
||||
{
|
||||
public enum EMainWindowViewType
|
||||
{
|
||||
Home,
|
||||
ProjectList,
|
||||
SchachtList,
|
||||
SchachtEdit,
|
||||
HaltungList,
|
||||
SewerConnectionEdit
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.HostBuilders
|
||||
{
|
||||
static class AddConfigurationHostBuilderExtensions
|
||||
{
|
||||
public static IHostBuilder AddConfiguration(this IHostBuilder hostBuilder)
|
||||
{
|
||||
hostBuilder.ConfigureAppConfiguration(c =>
|
||||
{
|
||||
c.AddJsonFile("appsettings.json");
|
||||
c.AddEnvironmentVariables();
|
||||
}
|
||||
);
|
||||
return hostBuilder;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
|
||||
using Microsoft.Extensions.Configuration;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.HostBuilders
|
||||
{
|
||||
static class AddDBContextHostBuilderExtensions
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using SewerStammGen.DAL.Services;
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using SewerStammGen.WPF.ViewModel.State.Navigation;
|
||||
using Shared.Contracts;
|
||||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.HostBuilders
|
||||
{
|
||||
internal static class AddServicesHostBuilderExtensions
|
||||
{
|
||||
public static IHostBuilder AddServices(this IHostBuilder host)
|
||||
{
|
||||
host.ConfigureServices(services =>
|
||||
{
|
||||
services.AddSingleton<IMainWindowNavigator, MainWindowNavigator>();
|
||||
services.AddSingleton<ViewModelDelegateRenavigator<ProjektEditViewModel>>();
|
||||
services.AddSingleton<IProjektDataService, ProjektDataService>();
|
||||
services.AddSingleton<IAuftraggeberDataService, AuftraggeberDataService>();
|
||||
services.AddSingleton<ISchachtDataService, SchachtDataService>();
|
||||
|
||||
|
||||
});
|
||||
return host;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,23 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.HostBuilders
|
||||
{
|
||||
static class AddStoresHostBuilderExtensions
|
||||
{
|
||||
public static IHostBuilder AddStores(this IHostBuilder hostBuilder)
|
||||
{
|
||||
hostBuilder.ConfigureServices(services =>
|
||||
{
|
||||
services.AddSingleton<IActualState, ActualState>();
|
||||
});
|
||||
return hostBuilder;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,111 @@
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Hosting;
|
||||
using SewerStammGen.WPF.Commands;
|
||||
using SewerStammGen.WPF.Interface;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using SewerStammGen.WPF.ViewModel.State.Navigation;
|
||||
using SewerStammGen.WPF.ViewModel.Factories;
|
||||
using Shared.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net.Security;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
|
||||
namespace SewerStammGen.HostBuilders
|
||||
{
|
||||
static class AddViewModelsHostBuilderExtensions
|
||||
{
|
||||
public static IHostBuilder AddViewModels(this IHostBuilder hostBuilder)
|
||||
{
|
||||
hostBuilder.ConfigureServices(services =>
|
||||
{
|
||||
|
||||
services.AddTransient<MainWindowViewModel>();
|
||||
|
||||
services.AddSingleton<ViewModelDelegateRenavigator<ProjektListViewModel>>();
|
||||
services.AddSingleton<ViewModelDelegateRenavigator<ProjektEditViewModel>>();
|
||||
|
||||
services.AddSingleton<ViewModelDelegateRenavigator<ManholeListViewModel>>();
|
||||
services.AddSingleton<ViewModelDelegateRenavigator<ManholeEditViewModel>>();
|
||||
|
||||
services.AddSingleton<ViewModelDelegateRenavigator<HaltungListViewModel>>();
|
||||
services.AddSingleton<ViewModelDelegateRenavigator<HaltungEditViewModel>>();
|
||||
|
||||
services.AddSingleton<CreateViewModel<HomeViewModel>>(services =>
|
||||
{
|
||||
return () => new HomeViewModel();
|
||||
});
|
||||
|
||||
#region Schächte
|
||||
services.AddSingleton<CreateViewModel<ManholeListViewModel>>(services =>
|
||||
{
|
||||
return () => new ManholeListViewModel(
|
||||
services.GetRequiredService<ISchachtDataService>(),
|
||||
services.GetRequiredService<IDataService<Projekt>>(),
|
||||
services.GetRequiredService<ViewModelDelegateRenavigator<ManholeEditViewModel>>(),
|
||||
services.GetRequiredService<IActualState>()
|
||||
|
||||
);
|
||||
});
|
||||
|
||||
services.AddSingleton<CreateViewModel<ManholeEditViewModel>>(services =>
|
||||
{
|
||||
return () => new ManholeEditViewModel(
|
||||
services.GetRequiredService<IDataService<Schacht>>(),
|
||||
services.GetRequiredService<IActualState>()
|
||||
);
|
||||
});
|
||||
#endregion
|
||||
|
||||
#region Haltungen
|
||||
services.AddSingleton<CreateViewModel<HaltungListViewModel>>(services =>
|
||||
{
|
||||
return () => new HaltungListViewModel(
|
||||
|
||||
services.GetRequiredService<IActualState>(),
|
||||
services.GetRequiredService<ViewModelDelegateRenavigator<HaltungEditViewModel>>()
|
||||
);
|
||||
});
|
||||
|
||||
services.AddTransient<CreateViewModel<HaltungEditViewModel>>(services =>
|
||||
{
|
||||
return () => new HaltungEditViewModel(
|
||||
|
||||
|
||||
services.GetRequiredService<IActualState>()
|
||||
);
|
||||
});
|
||||
#endregion
|
||||
|
||||
#region Projekte
|
||||
services.AddSingleton<CreateViewModel<ProjektEditViewModel>>(services =>
|
||||
{
|
||||
return () => new ProjektEditViewModel(
|
||||
services.GetRequiredService<IProjektDataService>(),
|
||||
services.GetRequiredService<ViewModelDelegateRenavigator<ProjektListViewModel>>(),
|
||||
services.GetRequiredService<IActualState>()
|
||||
);
|
||||
});
|
||||
|
||||
services.AddSingleton<CreateViewModel<ProjektListViewModel>>(services =>
|
||||
{
|
||||
return () => new ProjektListViewModel(
|
||||
services.GetRequiredService<IProjektDataService>(),
|
||||
services.GetRequiredService<ViewModelDelegateRenavigator<ProjektEditViewModel>>(),
|
||||
services.GetRequiredService<IActualState>()
|
||||
);
|
||||
});
|
||||
#endregion
|
||||
|
||||
services.AddSingleton<IViewModelAbstractFactory, MainWindowViewModelFactory>();
|
||||
});
|
||||
|
||||
return hostBuilder;
|
||||
}
|
||||
}
|
||||
}
|
||||
15
SewerStammGen.WPF/Interface/IViewModelAbstractFactory.cs
Normal file
15
SewerStammGen.WPF/Interface/IViewModelAbstractFactory.cs
Normal file
@@ -0,0 +1,15 @@
|
||||
using SewerStammGen.Enum;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Interface
|
||||
{
|
||||
public interface IViewModelAbstractFactory
|
||||
{
|
||||
BaseViewModel CreateViewModel(EMainWindowViewType viewType);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Interface.Navigator
|
||||
{
|
||||
public interface IMainWindowNavigator : INavigator
|
||||
{
|
||||
}
|
||||
}
|
||||
19
SewerStammGen.WPF/Interface/Navigator/INavigator.cs
Normal file
19
SewerStammGen.WPF/Interface/Navigator/INavigator.cs
Normal file
@@ -0,0 +1,19 @@
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Interface.Navigator
|
||||
{
|
||||
public interface INavigator
|
||||
{
|
||||
BaseViewModel CurrentViewModel
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
event Action StateChanged;
|
||||
}
|
||||
}
|
||||
13
SewerStammGen.WPF/Interface/Navigator/IRenavigator.cs
Normal file
13
SewerStammGen.WPF/Interface/Navigator/IRenavigator.cs
Normal file
@@ -0,0 +1,13 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Interface.Navigator
|
||||
{
|
||||
public interface IRenavigator
|
||||
{
|
||||
void Renavigate();
|
||||
}
|
||||
}
|
||||
54
SewerStammGen.WPF/MainWindow.xaml
Normal file
54
SewerStammGen.WPF/MainWindow.xaml
Normal file
@@ -0,0 +1,54 @@
|
||||
<Window x:Class="SewerStammGen.WPF.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:my="clr-namespace:SewerStammGen.WPF.Views"
|
||||
xmlns:local="clr-namespace:SewerStammGen.WPF"
|
||||
xmlns:view="clr-namespace:SewerStammGen.WPF.Views"
|
||||
xmlns:viewmodel="clr-namespace:SewerStammGen.WPF.ViewModel"
|
||||
xmlns:controls="clr-namespace:SewerStammGen.WPF.Views.Controls"
|
||||
mc:Ignorable="d"
|
||||
Title="{Binding ApplicationTitle}" Height="450" Width="800" FontSize="20"
|
||||
WindowState="Maximized"
|
||||
>
|
||||
<Window.Resources>
|
||||
<DataTemplate DataType="{x:Type viewmodel:HomeViewModel}">
|
||||
<view:HomeView />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type viewmodel:ManholeListViewModel}">
|
||||
<view:SchachtListView />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type viewmodel:ManholeEditViewModel}">
|
||||
<view:SchachtEditView />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type viewmodel:HaltungListViewModel}">
|
||||
<view:HaltungListView />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type viewmodel:HaltungEditViewModel}">
|
||||
<view:HaltungEditView />
|
||||
</DataTemplate>
|
||||
|
||||
<DataTemplate DataType="{x:Type viewmodel:ProjektListViewModel}">
|
||||
<view:ProjektListView />
|
||||
</DataTemplate>
|
||||
<DataTemplate DataType="{x:Type viewmodel:ProjektEditViewModel}">
|
||||
<view:ProjektEditView />
|
||||
</DataTemplate>
|
||||
</Window.Resources>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<controls:UCMainWindowNavigationBar Grid.Column="0" />
|
||||
<ContentControl Grid.Column="1" Content="{Binding CurrentViewModel}" />
|
||||
<StatusBar Grid.Row="1" Grid.ColumnSpan="2">
|
||||
<StatusBarItem Content="{Binding Projektnummer}" />
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
</Window>
|
||||
30
SewerStammGen.WPF/MainWindow.xaml.cs
Normal file
30
SewerStammGen.WPF/MainWindow.xaml.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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 SewerStammGen.WPF
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaction logic for MainWindow.xaml
|
||||
/// </summary>
|
||||
public partial class MainWindow : Window
|
||||
{
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
//SewerConnector.DataContext = new ViewModel.SewerConnectorViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
32
SewerStammGen.WPF/SewerStammGen.WPF.csproj
Normal file
32
SewerStammGen.WPF/SewerStammGen.WPF.csproj
Normal file
@@ -0,0 +1,32 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>WinExe</OutputType>
|
||||
<TargetFramework>net7.0-windows</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<UseWPF>true</UseWPF>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.EntityFrameworkCore.Design" Version="7.0.4">
|
||||
<PrivateAssets>all</PrivateAssets>
|
||||
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
|
||||
</PackageReference>
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting" Version="7.0.1" />
|
||||
<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="7.0.0" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
|
||||
<PackageReference Include="Syncfusion.SfGrid.WPF" Version="20.4.0.54" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\SewerStammGen.DAL\SewerStammGen.DAL.csproj" />
|
||||
<ProjectReference Include="..\SewerStammGen.Shared\SewerStammGen.Shared.csproj" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="appsettings.json">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
73
SewerStammGen.WPF/SewerStammGen.WPF.csproj.user
Normal file
73
SewerStammGen.WPF/SewerStammGen.WPF.csproj.user
Normal file
@@ -0,0 +1,73 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="Current" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup />
|
||||
<ItemGroup>
|
||||
<ApplicationDefinition Update="App.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</ApplicationDefinition>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Update="Views\Haltung\HaltungEditView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Haltung\HaltungListView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Controls\UCMainWindowNavigationBar.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\HomeView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Projekt\ProjektEditView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Projekt\ProjektListView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Schacht\SchachtListView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\Schacht\SchachtEditView.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
<Compile Update="Views\UCNormXML.xaml.cs">
|
||||
<SubType>Code</SubType>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Page Update="MainWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\Haltung\HaltungEditView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\Haltung\HaltungListView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\Controls\UCMainWindowNavigationBar.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\HomeView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\Projekt\ProjektEditView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\Projekt\ProjektListView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\Schacht\SchachtListView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\styles\my_controls.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\Schacht\SchachtEditView.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
<Page Update="Views\UCNormXML.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
</Page>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
14
SewerStammGen.WPF/ViewModel/BaseViewModel.cs
Normal file
14
SewerStammGen.WPF/ViewModel/BaseViewModel.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel
|
||||
{
|
||||
public delegate TViewModel CreateViewModel<TViewModel>() where TViewModel : BaseViewModel;
|
||||
public class BaseViewModel : ObservableObject
|
||||
{
|
||||
public virtual void Dispose() { }
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,56 @@
|
||||
using SewerStammGen.Enum;
|
||||
using SewerStammGen.WPF.Interface;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel.Factories
|
||||
{
|
||||
public class MainWindowViewModelFactory : IViewModelAbstractFactory
|
||||
{
|
||||
private CreateViewModel<HomeViewModel> _createHomeViewModel;
|
||||
private CreateViewModel<ManholeEditViewModel> _createManholeEditViewModel;
|
||||
private CreateViewModel<ManholeListViewModel> _createManholeListViewModel;
|
||||
private CreateViewModel<HaltungListViewModel> _createHaltungListViewModel;
|
||||
//private CreateViewModel<SewerConnectorViewModel> _createSewerConnectorViewModel;
|
||||
private CreateViewModel<ProjektListViewModel> _createProjektListViewModel;
|
||||
|
||||
public MainWindowViewModelFactory(
|
||||
CreateViewModel<HomeViewModel> createHomeViewModel,
|
||||
CreateViewModel<ManholeEditViewModel> createManholeEditViewModel,
|
||||
CreateViewModel<ManholeListViewModel> createManholeListViewModel,
|
||||
CreateViewModel<HaltungListViewModel> createHaltungListViewModel,
|
||||
|
||||
CreateViewModel<ProjektListViewModel> createProjektListViewModel
|
||||
)
|
||||
{
|
||||
_createHomeViewModel = createHomeViewModel;
|
||||
_createManholeEditViewModel = createManholeEditViewModel;
|
||||
//_createSewerConnectorViewModel = createSewerConnectorViewModel;
|
||||
_createProjektListViewModel = createProjektListViewModel;
|
||||
_createManholeListViewModel = createManholeListViewModel;
|
||||
_createHaltungListViewModel = createHaltungListViewModel;
|
||||
}
|
||||
|
||||
public BaseViewModel CreateViewModel(EMainWindowViewType viewType)
|
||||
{
|
||||
switch(viewType)
|
||||
{
|
||||
case EMainWindowViewType.Home: return _createHomeViewModel();
|
||||
|
||||
case EMainWindowViewType.SchachtList: return _createManholeListViewModel();
|
||||
case EMainWindowViewType.SchachtEdit: return _createManholeEditViewModel();
|
||||
|
||||
case EMainWindowViewType.HaltungList: return _createHaltungListViewModel();
|
||||
//case EMainWindowViewType.SewerConnectionEdit: return _createSewerConnectorViewModel();
|
||||
|
||||
case EMainWindowViewType.ProjectList: return _createProjektListViewModel();
|
||||
|
||||
default:
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
144
SewerStammGen.WPF/ViewModel/Haltung/HaltungEditViewModel.cs
Normal file
144
SewerStammGen.WPF/ViewModel/Haltung/HaltungEditViewModel.cs
Normal file
@@ -0,0 +1,144 @@
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.WPF.Commands;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using Shared.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel
|
||||
{
|
||||
internal class HaltungEditViewModel : BaseViewModel
|
||||
{
|
||||
private readonly IActualState _actualState;
|
||||
//private readonly IHaltungDataService _kanalDataService;
|
||||
|
||||
private Kanal _model;
|
||||
|
||||
public Kanal Model
|
||||
{
|
||||
get => _model;
|
||||
set
|
||||
{
|
||||
_model = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string _oberePunkt { get; set; }
|
||||
public string _unterePunkt { get; set; }
|
||||
|
||||
public string ObereSchacht
|
||||
{
|
||||
get => _oberePunkt;
|
||||
|
||||
set
|
||||
{
|
||||
if (_oberePunkt != value)
|
||||
{
|
||||
_oberePunkt = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public string UntereSchacht
|
||||
{
|
||||
get => _unterePunkt;
|
||||
set
|
||||
{
|
||||
if (_unterePunkt != value)
|
||||
{
|
||||
_unterePunkt = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public string Haltungsbezeichnung
|
||||
{
|
||||
get => _model.Objektbezeichnung;
|
||||
set
|
||||
{
|
||||
if(_model.Objektbezeichnung != value)
|
||||
{
|
||||
_model.Objektbezeichnung = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public string Material
|
||||
{
|
||||
get => _model.Material;
|
||||
set
|
||||
{
|
||||
if( _model.Material != value)
|
||||
{
|
||||
_model.Material = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public string Durchmesser
|
||||
{
|
||||
get => _model.DN.ToString();
|
||||
set
|
||||
{
|
||||
if(_model.DN.ToString() != value)
|
||||
{
|
||||
_model.DN = int.Parse(value);
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public string Haltungslaenge
|
||||
{
|
||||
get => _model.Haltungslaenge.ToString();
|
||||
set
|
||||
{
|
||||
if(_model.Haltungslaenge.ToString() != value)
|
||||
{
|
||||
_model.Haltungslaenge = decimal.Parse(value);
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ICommand Speichern { get; set; }
|
||||
|
||||
public HaltungEditViewModel(
|
||||
|
||||
IActualState actualState)
|
||||
{
|
||||
_actualState = actualState;
|
||||
//_kanalDataService = kanalDataService;
|
||||
|
||||
_model = new Kanal();
|
||||
Speichern = new HaltungEditSaveCommand(this);
|
||||
|
||||
LoadModel();
|
||||
|
||||
}
|
||||
|
||||
|
||||
private async void LoadModel()
|
||||
{
|
||||
/*_model = await _kanalDataService.Get(_actualState.HaltungID);
|
||||
UntereSchacht = _model.EndSchacht.Objektbezeichnung;
|
||||
ObereSchacht = _model.StartSchacht.Objektbezeichnung;
|
||||
OnPropertyChanged(nameof(ObereSchacht));
|
||||
OnPropertyChanged(nameof(UntereSchacht));
|
||||
OnPropertyChanged(nameof(Haltungslaenge));
|
||||
OnPropertyChanged(nameof(Haltungsbezeichnung));
|
||||
OnPropertyChanged(nameof(Material));
|
||||
OnPropertyChanged(nameof(Durchmesser));
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
57
SewerStammGen.WPF/ViewModel/Haltung/HaltungListViewModel.cs
Normal file
57
SewerStammGen.WPF/ViewModel/Haltung/HaltungListViewModel.cs
Normal file
@@ -0,0 +1,57 @@
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.WPF.Commands;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel
|
||||
{
|
||||
public class HaltungListViewModel : BaseViewModel
|
||||
{
|
||||
private readonly ObservableCollection<Kanal> _haltungen;
|
||||
private readonly IActualState _actualState;
|
||||
//private readonly IHaltungDataService _haltungDataService;
|
||||
|
||||
public Kanal? SelectedHaltung { get; set; }
|
||||
public ObservableCollection<Kanal> Haltungen { get => _haltungen; }
|
||||
|
||||
public ICommand EditCommand { get; set; }
|
||||
public ICommand AddCommand { get; set; }
|
||||
|
||||
public HaltungListViewModel( IActualState actualState, IRenavigator renavigator )
|
||||
{
|
||||
_haltungen = new ObservableCollection<Kanal>();
|
||||
|
||||
_actualState = actualState;
|
||||
|
||||
|
||||
EditCommand = new HaltungEditCommand(actualState, renavigator, this);
|
||||
AddCommand = new HaltungAddCommand();
|
||||
|
||||
LoadHaltungen();
|
||||
}
|
||||
|
||||
private async void LoadHaltungen()
|
||||
{
|
||||
/* var haltungen = await _haltungDataService.GetAll(_actualState.ProjektID);
|
||||
InitCollection(_haltungen, haltungen);
|
||||
*/
|
||||
}
|
||||
|
||||
private void InitCollection(ObservableCollection<Kanal> dest, IEnumerable<Kanal> source)
|
||||
{
|
||||
dest.Clear();
|
||||
foreach (var sourceItem in source)
|
||||
{
|
||||
dest.Add(sourceItem);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
18
SewerStammGen.WPF/ViewModel/Haltung/TextBoxFilterAction.cs
Normal file
18
SewerStammGen.WPF/ViewModel/Haltung/TextBoxFilterAction.cs
Normal file
@@ -0,0 +1,18 @@
|
||||
using Microsoft.Xaml.Behaviors;
|
||||
using Syncfusion.UI.Xaml.Grid;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.Views
|
||||
{
|
||||
public class TextBoxFilterAction : TargetedTriggerAction<SfMultiColumnDropDownControl>
|
||||
{
|
||||
protected override void Invoke(object parameter)
|
||||
{
|
||||
throw new NotImplementedException();
|
||||
}
|
||||
}
|
||||
}
|
||||
12
SewerStammGen.WPF/ViewModel/HomeViewModel.cs
Normal file
12
SewerStammGen.WPF/ViewModel/HomeViewModel.cs
Normal file
@@ -0,0 +1,12 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel
|
||||
{
|
||||
public class HomeViewModel : BaseViewModel
|
||||
{
|
||||
}
|
||||
}
|
||||
67
SewerStammGen.WPF/ViewModel/MainWindowViewModel.cs
Normal file
67
SewerStammGen.WPF/ViewModel/MainWindowViewModel.cs
Normal file
@@ -0,0 +1,67 @@
|
||||
using SewerStammGen.WPF.Commands;
|
||||
using SewerStammGen.Enum;
|
||||
using SewerStammGen.WPF.Interface;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel
|
||||
{
|
||||
public class MainWindowViewModel : BaseViewModel
|
||||
{
|
||||
public IMainWindowNavigator Navigator { get; set; }
|
||||
public string? Projektnummer { get; set; }
|
||||
private readonly IActualState _actualState;
|
||||
public BaseViewModel CurrentViewModel => Navigator.CurrentViewModel;
|
||||
|
||||
public ICommand UpdateCurrentViewModelCommand { get; }
|
||||
|
||||
public static string ApplicationTitle
|
||||
{
|
||||
get => "Stammdatengenerator Version 0.1";
|
||||
}
|
||||
|
||||
public MainWindowViewModel(
|
||||
IMainWindowNavigator navigator,
|
||||
IViewModelAbstractFactory viewModelFactory,
|
||||
IActualState actualState
|
||||
|
||||
)
|
||||
{
|
||||
Navigator = navigator;
|
||||
|
||||
UpdateCurrentViewModelCommand = new UpdateCurrentViewModelCommand(navigator, viewModelFactory);
|
||||
UpdateCurrentViewModelCommand.Execute(EMainWindowViewType.Home);
|
||||
|
||||
_actualState = actualState;
|
||||
|
||||
_actualState.ProjektChanged += ActualState_ProjektChanged;
|
||||
|
||||
|
||||
Navigator.StateChanged += Navigator_StateChanged;
|
||||
|
||||
|
||||
|
||||
#if DEBUG
|
||||
_actualState.ProjektID = 5;
|
||||
#endif
|
||||
}
|
||||
|
||||
private void ActualState_ProjektChanged(object? sender, EventArgs e)
|
||||
{
|
||||
Projektnummer = _actualState.ProjektID.ToString();
|
||||
OnPropertyChanged(nameof(Projektnummer));
|
||||
}
|
||||
|
||||
private void Navigator_StateChanged()
|
||||
{
|
||||
OnPropertyChanged(nameof(CurrentViewModel));
|
||||
}
|
||||
}
|
||||
}
|
||||
14
SewerStammGen.WPF/ViewModel/ObservableObject.cs
Normal file
14
SewerStammGen.WPF/ViewModel/ObservableObject.cs
Normal file
@@ -0,0 +1,14 @@
|
||||
using System.ComponentModel;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel
|
||||
{
|
||||
public class ObservableObject : INotifyPropertyChanged
|
||||
{
|
||||
public event PropertyChangedEventHandler? PropertyChanged;
|
||||
protected virtual void OnPropertyChanged([CallerMemberName] string? propertyName = null)
|
||||
{
|
||||
PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
|
||||
}
|
||||
}
|
||||
}
|
||||
117
SewerStammGen.WPF/ViewModel/Projekt/ProjektEditViewModel.cs
Normal file
117
SewerStammGen.WPF/ViewModel/Projekt/ProjektEditViewModel.cs
Normal file
@@ -0,0 +1,117 @@
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using Shared.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Security.RightsManagement;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel
|
||||
{
|
||||
internal class ProjektEditViewModel : BaseViewModel
|
||||
{
|
||||
private Projekt _model;
|
||||
private int ProjektID;
|
||||
private readonly IDataService<Projekt> _dataService;
|
||||
private readonly IRenavigator _renavigator;
|
||||
|
||||
public ICommand Speichern { get; set; }
|
||||
public string ProjektName
|
||||
{
|
||||
get => _model.Projektname;
|
||||
set
|
||||
{
|
||||
if(_model.Projektname != value)
|
||||
{
|
||||
_model.Projektname = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public string Erstelldatum
|
||||
{
|
||||
get => _model.Erstelldatum;
|
||||
set
|
||||
{
|
||||
if (_model.Erstelldatum != value)
|
||||
{
|
||||
_model.Erstelldatum = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public string Strasse
|
||||
{
|
||||
get => _model.Strasse;
|
||||
set
|
||||
{
|
||||
if (_model.Strasse != value)
|
||||
{
|
||||
_model.Strasse = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public string Ort
|
||||
{
|
||||
get => _model.Ort;
|
||||
set
|
||||
{
|
||||
if (_model.Ort != value)
|
||||
{
|
||||
_model.Ort = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ProjektEditViewModel(IDataService<Projekt> dataService, IRenavigator renavigator, IActualState actualState)
|
||||
{
|
||||
_dataService = dataService;
|
||||
_renavigator = renavigator;
|
||||
|
||||
ProjektID = actualState.ProjektID;
|
||||
|
||||
_model = new Projekt();
|
||||
Speichern = new RelayCommand((x) => this.SaveProject());
|
||||
|
||||
LoadProjekt();
|
||||
}
|
||||
|
||||
private async void LoadProjekt()
|
||||
{
|
||||
|
||||
_model = await _dataService.Get(ProjektID);
|
||||
if(_model == null)
|
||||
{
|
||||
_model = new Projekt()
|
||||
{
|
||||
Auftraggeber = new Auftraggeber(),
|
||||
};
|
||||
}
|
||||
OnPropertyChanged(nameof(ProjektName));
|
||||
OnPropertyChanged(nameof(Erstelldatum));
|
||||
OnPropertyChanged(nameof(Strasse));
|
||||
OnPropertyChanged(nameof(Ort));
|
||||
}
|
||||
|
||||
private void SaveProject()
|
||||
{
|
||||
if (_model.Id == 0) // Handelt sich um ein neuen Eintrag
|
||||
{
|
||||
_dataService.Create(_model);
|
||||
}
|
||||
else
|
||||
{
|
||||
_dataService.Update(_model);
|
||||
}
|
||||
_renavigator.Renavigate();
|
||||
}
|
||||
}
|
||||
}
|
||||
78
SewerStammGen.WPF/ViewModel/Projekt/ProjektListViewModel.cs
Normal file
78
SewerStammGen.WPF/ViewModel/Projekt/ProjektListViewModel.cs
Normal file
@@ -0,0 +1,78 @@
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.WPF.Commands;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using Shared.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel
|
||||
{
|
||||
public class ProjektListViewModel : BaseViewModel
|
||||
{
|
||||
private IProjektDataService genericDataService;
|
||||
private readonly ObservableCollection<Projekt> _projekte;
|
||||
private readonly IActualState _actualState;
|
||||
public ObservableCollection<Projekt> Projekte { get => _projekte; }
|
||||
public bool CanSelectProjekt => _selectedProjekt != null;
|
||||
|
||||
public ICommand SelectCommand { get; set; }
|
||||
public ICommand AddCommand { get; set; }
|
||||
public ICommand EditCommand { get; set; }
|
||||
|
||||
private Projekt? _selectedProjekt;
|
||||
|
||||
|
||||
|
||||
public Projekt? SelectedProjekt
|
||||
{
|
||||
get => _selectedProjekt;
|
||||
set
|
||||
{
|
||||
if(_selectedProjekt != value)
|
||||
{
|
||||
_selectedProjekt = value;
|
||||
OnPropertyChanged();
|
||||
OnPropertyChanged(nameof(CanSelectProjekt));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ProjektListViewModel(IProjektDataService generic, IRenavigator renavigator,IActualState actualState)
|
||||
{
|
||||
_projekte = new ObservableCollection<Projekt>();
|
||||
if (generic == null) throw new ArgumentNullException(nameof(generic));
|
||||
this.genericDataService = generic;
|
||||
_actualState = actualState;
|
||||
AddCommand = new ProjektAddCommand(generic,actualState, renavigator);
|
||||
SelectCommand = new ProjektSelectCommand(actualState,this);
|
||||
EditCommand = new ProjektEditCommand(generic, actualState, renavigator, this);
|
||||
|
||||
LoadProjekte();
|
||||
}
|
||||
|
||||
private async void LoadProjekte()
|
||||
{
|
||||
var projects = await genericDataService.GetAll();
|
||||
|
||||
InitCollection(_projekte, projects);
|
||||
|
||||
}
|
||||
|
||||
private void InitCollection(ObservableCollection<Projekt> projekte, IEnumerable<Projekt> projects)
|
||||
{
|
||||
projekte.Clear();
|
||||
foreach(var i in projects)
|
||||
{
|
||||
projekte.Add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
50
SewerStammGen.WPF/ViewModel/RelayCommand.cs
Normal file
50
SewerStammGen.WPF/ViewModel/RelayCommand.cs
Normal file
@@ -0,0 +1,50 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel
|
||||
{
|
||||
[Serializable]
|
||||
class RelayCommand : ICommand
|
||||
{
|
||||
#region Fields
|
||||
private readonly Action<object> execute;
|
||||
private readonly Predicate<object> canExecute;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public RelayCommand(Action<object> execute) : this(execute, null) { }
|
||||
|
||||
public RelayCommand(Action<object> execute, Predicate<object> canExecute)
|
||||
{
|
||||
if (execute == null) throw new ArgumentNullException("execute");
|
||||
this.execute = execute;
|
||||
this.canExecute = canExecute;
|
||||
}
|
||||
#endregion
|
||||
|
||||
#region ICommand Members
|
||||
[DebuggerStepThrough]
|
||||
public bool CanExecute(object parameter)
|
||||
{
|
||||
if (canExecute == null) return true;
|
||||
return canExecute(parameter);
|
||||
}
|
||||
|
||||
public event EventHandler CanExecuteChanged
|
||||
{
|
||||
add { CommandManager.RequerySuggested += value; }
|
||||
remove { CommandManager.RequerySuggested -= value; }
|
||||
}
|
||||
|
||||
public void Execute(object parameter)
|
||||
{
|
||||
execute(parameter);
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
126
SewerStammGen.WPF/ViewModel/Schacht/ManholeEditViewModel.cs
Normal file
126
SewerStammGen.WPF/ViewModel/Schacht/ManholeEditViewModel.cs
Normal file
@@ -0,0 +1,126 @@
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using Shared.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel
|
||||
{
|
||||
public class ManholeEditViewModel : BaseViewModel
|
||||
{
|
||||
private readonly IActualState _actualState;
|
||||
private readonly IDataService<Schacht> _schachtDataService;
|
||||
|
||||
private Schacht _model;
|
||||
|
||||
public ICommand Speichern { get; set; }
|
||||
|
||||
public string Objektbezeichnung
|
||||
{
|
||||
get
|
||||
{
|
||||
return _model.Objektbezeichnung;
|
||||
}
|
||||
set
|
||||
{
|
||||
if(_model.Objektbezeichnung != value)
|
||||
{
|
||||
_model.Objektbezeichnung = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public decimal RechtsWert
|
||||
{
|
||||
get => _model.RechtsWert;
|
||||
set
|
||||
{
|
||||
if(_model.RechtsWert != value)
|
||||
{
|
||||
_model.RechtsWert = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public decimal HochWert
|
||||
{
|
||||
get => _model.HochWert; set
|
||||
{
|
||||
if (_model.HochWert != value)
|
||||
{
|
||||
_model.HochWert = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public decimal DeckelHoehe
|
||||
{
|
||||
get => _model.DeckelHoehe;
|
||||
set
|
||||
{
|
||||
if (_model.DeckelHoehe != value)
|
||||
{
|
||||
_model.DeckelHoehe = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public decimal SohlHoehe
|
||||
{
|
||||
get => _model.SohlHoehe;
|
||||
set
|
||||
{
|
||||
if (_model.SohlHoehe != value)
|
||||
{
|
||||
_model.SohlHoehe = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
public EEntwaeserung Entwaeserung
|
||||
{
|
||||
get => _model.Entwaesserung;
|
||||
set
|
||||
{
|
||||
if (_model.Entwaesserung != value)
|
||||
{
|
||||
_model.Entwaesserung = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public ManholeEditViewModel(IDataService<Schacht> schachtDataService,IActualState actualState)
|
||||
{
|
||||
_actualState = actualState;
|
||||
_schachtDataService = schachtDataService;
|
||||
_model = new Schacht();
|
||||
|
||||
Speichern = new RelayCommand((x) => SaveSchacht());
|
||||
|
||||
LoadModel();
|
||||
|
||||
|
||||
}
|
||||
|
||||
private void SaveSchacht()
|
||||
{
|
||||
//_schachtDataService.Update(_model.Id, _model);
|
||||
}
|
||||
|
||||
private async void LoadModel()
|
||||
{
|
||||
_model = await _schachtDataService.Get(_actualState.SchachtID);
|
||||
OnPropertyChanged(nameof(Entwaeserung));
|
||||
OnPropertyChanged(nameof(Objektbezeichnung));
|
||||
OnPropertyChanged(nameof(HochWert));
|
||||
OnPropertyChanged(nameof(RechtsWert));
|
||||
OnPropertyChanged(nameof(DeckelHoehe));
|
||||
OnPropertyChanged(nameof(SohlHoehe));
|
||||
}
|
||||
}
|
||||
}
|
||||
62
SewerStammGen.WPF/ViewModel/Schacht/ManholeListViewModel.cs
Normal file
62
SewerStammGen.WPF/ViewModel/Schacht/ManholeListViewModel.cs
Normal file
@@ -0,0 +1,62 @@
|
||||
using SewerStammGen.Shared.Contracts;
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using SewerStammGen.WPF.Commands;
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using SewerStammGen.WPF.ViewModel.State;
|
||||
using Shared.Contracts;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Input;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel
|
||||
{
|
||||
public class ManholeListViewModel : BaseViewModel
|
||||
{
|
||||
private ISchachtDataService _schachtDataService;
|
||||
private readonly ObservableCollection<Schacht> _schaechte;
|
||||
private readonly IActualState _actualState;
|
||||
|
||||
public ObservableCollection<Schacht> Schaechte { get => _schaechte; }
|
||||
|
||||
public Schacht? SelectedSchacht { get; set; }
|
||||
|
||||
public ICommand AddSchachtCommand { get; set; }
|
||||
public ICommand EditSchachtCommand { get; set; }
|
||||
public ICommand DeleteSchachtCommand { get; set; }
|
||||
|
||||
|
||||
public ManholeListViewModel(ISchachtDataService schachtDataService, IDataService<Projekt> projektService,IRenavigator renavigator ,IActualState actualState)
|
||||
{
|
||||
_schachtDataService = schachtDataService;
|
||||
_actualState = actualState;
|
||||
|
||||
_schaechte = new ObservableCollection<Schacht>();
|
||||
|
||||
|
||||
AddSchachtCommand = new SchachtAddCommand(projektService, actualState,renavigator);
|
||||
EditSchachtCommand = new SchachtEditCommand(schachtDataService, actualState, renavigator,this);
|
||||
DeleteSchachtCommand = new SchachtDeleteCommand(schachtDataService, actualState, renavigator, this);
|
||||
|
||||
LoadSchaechte();
|
||||
}
|
||||
|
||||
private async void LoadSchaechte()
|
||||
{
|
||||
//var schaechte = await _schachtDataService.GetAll(_actualState.ProjektID);
|
||||
//InitCollection(_schaechte, schaechte);
|
||||
}
|
||||
|
||||
private void InitCollection(ObservableCollection<Schacht> dest, IEnumerable<Schacht> source)
|
||||
{
|
||||
dest.Clear();
|
||||
foreach(var i in source)
|
||||
{
|
||||
dest.Add(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
61
SewerStammGen.WPF/ViewModel/State/ActualState.cs
Normal file
61
SewerStammGen.WPF/ViewModel/State/ActualState.cs
Normal file
@@ -0,0 +1,61 @@
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel.State
|
||||
{
|
||||
internal class ActualState : IActualState
|
||||
{
|
||||
// TODO: set auf private set setzen
|
||||
public int ProjektID { get; set; }
|
||||
|
||||
public int SchachtID { get; private set; }
|
||||
public int HaltungID { get; private set; }
|
||||
|
||||
public void SetProjekt(Projekt projekt, bool notification = true)
|
||||
{
|
||||
ProjektID = projekt.Id;
|
||||
if(notification)
|
||||
{
|
||||
OnProjektChanged();
|
||||
}
|
||||
}
|
||||
public void SetSchacht(Schacht schacht, bool notification = true)
|
||||
{
|
||||
SchachtID = schacht.Id;
|
||||
if(notification)
|
||||
{
|
||||
OnSchachtChanged();
|
||||
}
|
||||
}
|
||||
public void SetHaltung(Kanal haltung, bool notification = true)
|
||||
{
|
||||
HaltungID = haltung.Id;
|
||||
if(notification)
|
||||
{
|
||||
OnHaltungChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public event EventHandler? ProjektChanged;
|
||||
public event EventHandler? SchachtChanged;
|
||||
public event EventHandler? HaltungChanged;
|
||||
private void OnProjektChanged()
|
||||
{
|
||||
ProjektChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
private void OnSchachtChanged()
|
||||
{
|
||||
SchachtChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
private void OnHaltungChanged()
|
||||
{
|
||||
HaltungChanged?.Invoke(this, new EventArgs());
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
22
SewerStammGen.WPF/ViewModel/State/IActualState.cs
Normal file
22
SewerStammGen.WPF/ViewModel/State/IActualState.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
using SewerStammGen.Shared.Domain;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel.State
|
||||
{
|
||||
public interface IActualState
|
||||
{
|
||||
event EventHandler? ProjektChanged;
|
||||
// TODO: ProjektID set entfernen!
|
||||
int ProjektID { get; set; }
|
||||
int SchachtID { get; }
|
||||
int HaltungID { get; }
|
||||
|
||||
void SetProjekt(Projekt projekt, bool notification = true);
|
||||
void SetSchacht(Schacht schacht, bool notification = true);
|
||||
void SetHaltung(Kanal haltung, bool notification = true);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel.State.Navigation
|
||||
{
|
||||
internal class MainWindowNavigator : ObservableObject, IMainWindowNavigator
|
||||
{
|
||||
private BaseViewModel _currentViewModel;
|
||||
public BaseViewModel CurrentViewModel
|
||||
{
|
||||
get => _currentViewModel;
|
||||
set
|
||||
{
|
||||
_currentViewModel?.Dispose();
|
||||
_currentViewModel = value;
|
||||
StateChanged?.Invoke();
|
||||
}
|
||||
}
|
||||
public event Action StateChanged;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
using SewerStammGen.WPF.Interface.Navigator;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace SewerStammGen.WPF.ViewModel.State.Navigation
|
||||
{
|
||||
internal class ViewModelDelegateRenavigator<TViewModel> : IRenavigator where TViewModel : BaseViewModel
|
||||
{
|
||||
private readonly IMainWindowNavigator _navigator;
|
||||
private readonly CreateViewModel<TViewModel> _createViewModel;
|
||||
|
||||
public ViewModelDelegateRenavigator(IMainWindowNavigator navigator, CreateViewModel<TViewModel> createViewModel)
|
||||
{
|
||||
_navigator = navigator;
|
||||
_createViewModel = createViewModel;
|
||||
}
|
||||
public void Renavigate()
|
||||
{
|
||||
_navigator.CurrentViewModel = _createViewModel();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
<UserControl x:Class="SewerStammGen.WPF.Views.Controls.UCMainWindowNavigationBar"
|
||||
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:nav="clr-namespace:SewerStammGen.Enum"
|
||||
xmlns:viewmodel="clr-namespace:SewerStammGen.WPF.ViewModel"
|
||||
xmlns:converter="clr-namespace:SewerStammGen.WPF.Views.Converters"
|
||||
xmlns:local="clr-namespace:SewerStammGen.WPF.Views.Controls"
|
||||
mc:Ignorable="d"
|
||||
d:DataContext="{d:DesignInstance Type=viewmodel:MainWindowViewModel}"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<UserControl.Resources>
|
||||
<converter:EqualValueToParameterConverter x:Key="EqualValueToParameterConverter" />
|
||||
</UserControl.Resources>
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<RadioButton IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:HomeViewModel}}" Command="{Binding UpdateCurrentViewModelCommand}" CommandParameter="{x:Static nav:EMainWindowViewType.Home}" Style="{StaticResource ToggleButtonList}" Content="Home" />
|
||||
<RadioButton IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:ProjektListViewModel}}" Command="{Binding UpdateCurrentViewModelCommand}" CommandParameter="{x:Static nav:EMainWindowViewType.ProjectList}" Style="{StaticResource ToggleButtonList}" Content="Projekte" />
|
||||
<RadioButton IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:ManholeListViewModel}}" Command="{Binding UpdateCurrentViewModelCommand}" CommandParameter="{x:Static nav:EMainWindowViewType.SchachtList}" Style="{StaticResource ToggleButtonList}" Content="Schächte" />
|
||||
<RadioButton IsChecked="{Binding CurrentViewModel, Mode=OneWay, Converter={StaticResource EqualValueToParameterConverter}, ConverterParameter={x:Type viewmodel:HaltungListViewModel}}" Command="{Binding UpdateCurrentViewModelCommand}" CommandParameter="{x:Static nav:EMainWindowViewType.HaltungList}" Style="{StaticResource ToggleButtonList}" Content="Haltungen" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
@@ -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 SewerStammGen.WPF.Views.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für UCMainWindowNavigationBar.xaml
|
||||
/// </summary>
|
||||
public partial class UCMainWindowNavigationBar : UserControl
|
||||
{
|
||||
public UCMainWindowNavigationBar()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows.Data;
|
||||
|
||||
namespace SewerStammGen.WPF.Views.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();
|
||||
}
|
||||
}
|
||||
}
|
||||
69
SewerStammGen.WPF/Views/Haltung/HaltungEditView.xaml
Normal file
69
SewerStammGen.WPF/Views/Haltung/HaltungEditView.xaml
Normal file
@@ -0,0 +1,69 @@
|
||||
<UserControl x:Class="SewerStammGen.WPF.Views.HaltungEditView"
|
||||
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:SewerStammGen.WPF.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
|
||||
<Grid>
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid Grid.Row="0">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<Label Grid.Row="0" Grid.Column="0" Content="Obere Schacht" />
|
||||
<Label Grid.Row="1" Grid.Column="0" Content="Untere Schacht" />
|
||||
<Label Grid.Row="2" Grid.Column="0" Content="Haltungsbezeichnung" />
|
||||
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Margin="5" Text="{Binding ObereSchacht}" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Margin="5" Text="{Binding UntereSchacht}" />
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Margin="5" Text="{Binding Haltungsbezeichnung}" />
|
||||
</Grid>
|
||||
|
||||
<Grid Grid.Row="1">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" />
|
||||
<ColumnDefinition Width="59*" />
|
||||
<ColumnDefinition Width="241*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
</Grid.RowDefinitions>
|
||||
<Label VerticalAlignment="Center" Grid.Column="0" Content="Material" />
|
||||
<Label VerticalAlignment="Center" Grid.Row="1" Grid.Column="0" Content="Durchmesser" />
|
||||
<Label VerticalAlignment="Center" Grid.Row="2" Grid.Column="0" Content="Haltungslänge" />
|
||||
<Label VerticalAlignment="Center" Grid.Row="3" Grid.Column="0" Content="Entwässerungsart" />
|
||||
|
||||
<TextBox Grid.Row="0" Grid.Column="1" Margin="5,5,5,5" Text="{Binding Material}" Grid.ColumnSpan="2" />
|
||||
<TextBox Grid.Row="1" Grid.Column="1" Margin="5,5,5,5" Text="{Binding Durchmesser}" Grid.ColumnSpan="2" />
|
||||
<TextBox Grid.Row="2" Grid.Column="1" Margin="5,5,5,5" Text="{Binding Haltungslaenge}" Grid.ColumnSpan="2" />
|
||||
<DockPanel Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2">
|
||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Regenwasser" />
|
||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Schmutzwasser" />
|
||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Mischwasser" />
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
<StackPanel Grid.Row="4">
|
||||
<Button Content="Speichern" Command="{Binding Speichern}" />
|
||||
<!--<ListBox ItemsSource="{Binding VerfuegbareSchaechte }" />-->
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
SewerStammGen.WPF/Views/Haltung/HaltungEditView.xaml.cs
Normal file
28
SewerStammGen.WPF/Views/Haltung/HaltungEditView.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 SewerStammGen.WPF.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für HaltungEditView.xaml
|
||||
/// </summary>
|
||||
public partial class HaltungEditView : UserControl
|
||||
{
|
||||
public HaltungEditView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
19
SewerStammGen.WPF/Views/Haltung/HaltungListView.xaml
Normal file
19
SewerStammGen.WPF/Views/Haltung/HaltungListView.xaml
Normal file
@@ -0,0 +1,19 @@
|
||||
<UserControl x:Class="SewerStammGen.WPF.Views.HaltungListView"
|
||||
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:SewerStammGen.WPF.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<DataGrid ItemsSource="{Binding Haltungen}" SelectedItem="{Binding SelectedHaltung}" IsReadOnly="False">
|
||||
|
||||
</DataGrid>
|
||||
<Button Content="Hinzufügen" Command="{Binding AddCommand}" />
|
||||
<Button Content="Editieren" Command="{Binding EditCommand}" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
SewerStammGen.WPF/Views/Haltung/HaltungListView.xaml.cs
Normal file
28
SewerStammGen.WPF/Views/Haltung/HaltungListView.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 SewerStammGen.WPF.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für HaltungListView.xaml
|
||||
/// </summary>
|
||||
public partial class HaltungListView : UserControl
|
||||
{
|
||||
public HaltungListView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
12
SewerStammGen.WPF/Views/HomeView.xaml
Normal file
12
SewerStammGen.WPF/Views/HomeView.xaml
Normal file
@@ -0,0 +1,12 @@
|
||||
<UserControl x:Class="SewerStammGen.WPF.Views.HomeView"
|
||||
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:SewerStammGen.WPF.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<TextBlock Text="Willkommen dieses Programm generiert Stammdaten für die TV Inspektion" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
SewerStammGen.WPF/Views/HomeView.xaml.cs
Normal file
28
SewerStammGen.WPF/Views/HomeView.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 SewerStammGen.WPF.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für HomeView.xaml
|
||||
/// </summary>
|
||||
public partial class HomeView : UserControl
|
||||
{
|
||||
public HomeView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
35
SewerStammGen.WPF/Views/Projekt/ProjektEditView.xaml
Normal file
35
SewerStammGen.WPF/Views/Projekt/ProjektEditView.xaml
Normal file
@@ -0,0 +1,35 @@
|
||||
<UserControl x:Class="SewerStammGen.WPF.Views.ProjektEditView"
|
||||
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:SewerStammGen.WPF.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition Height="auto"/>
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="0" Content="Projektname" />
|
||||
<Label Grid.Column="0" Grid.Row="1" Content="Erstelldatum" />
|
||||
<Label Grid.Column="0" Grid.Row="2" Content="Strasse" />
|
||||
<Label Grid.Column="0" Grid.Row="3" Content="Ort" />
|
||||
|
||||
<TextBox Grid.Column="1" Grid.Row="0" Text="{Binding ProjektName}" />
|
||||
<TextBox Grid.Column="1" Grid.Row="1" Text="{Binding Erstelldatum}" />
|
||||
<TextBox Grid.Column="1" Grid.Row="2" Text="{Binding Strasse}" />
|
||||
<TextBox Grid.Column="1" Grid.Row="3" Text="{Binding Ort}" />
|
||||
|
||||
<Button Grid.ColumnSpan="2" Grid.Row="4" Content="Speichern" Command="{Binding Speichern}" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
SewerStammGen.WPF/Views/Projekt/ProjektEditView.xaml.cs
Normal file
28
SewerStammGen.WPF/Views/Projekt/ProjektEditView.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 SewerStammGen.WPF.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für ProjektEditView.xaml
|
||||
/// </summary>
|
||||
public partial class ProjektEditView : UserControl
|
||||
{
|
||||
public ProjektEditView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
25
SewerStammGen.WPF/Views/Projekt/ProjektListView.xaml
Normal file
25
SewerStammGen.WPF/Views/Projekt/ProjektListView.xaml
Normal file
@@ -0,0 +1,25 @@
|
||||
<UserControl x:Class="SewerStammGen.WPF.Views.ProjektListView"
|
||||
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:SewerStammGen.WPF.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<DataGrid Margin="10" SelectedItem="{Binding SelectedProjekt}" ItemsSource="{Binding Projekte}" IsReadOnly="True" SelectionMode="Single" AutoGenerateColumns="False">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Projektname" Binding="{Binding Projektname}" />
|
||||
<DataGridTextColumn Header="Erstelldatum" Binding="{Binding Erstelldatum}" />
|
||||
<DataGridTextColumn Header="Strasse" Binding="{Binding Strasse}" />
|
||||
<DataGridTextColumn Header="Ort" Binding="{Binding Ort}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Margin="2" FontSize="20" Content="Projekt Auswählen" IsEnabled="{Binding CanSelectProjekt}" Command="{Binding SelectCommand}" />
|
||||
<Button Margin="2" FontSize="20" Content="Projekt Editieren" IsEnabled="{Binding CanSelectProjekt}" Command="{Binding EditCommand}" />
|
||||
<Button Margin="2" FontSize="20" Content="Projekt Anlegen" Command="{Binding AddCommand}" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
SewerStammGen.WPF/Views/Projekt/ProjektListView.xaml.cs
Normal file
28
SewerStammGen.WPF/Views/Projekt/ProjektListView.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 SewerStammGen.WPF.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für ProjektListView.xaml
|
||||
/// </summary>
|
||||
public partial class ProjektListView : UserControl
|
||||
{
|
||||
public ProjektListView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
48
SewerStammGen.WPF/Views/Schacht/SchachtEditView.xaml
Normal file
48
SewerStammGen.WPF/Views/Schacht/SchachtEditView.xaml
Normal file
@@ -0,0 +1,48 @@
|
||||
<UserControl x:Class="SewerStammGen.WPF.Views.SchachtEditView"
|
||||
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:SewerStammGen.WPF.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="auto" />
|
||||
<ColumnDefinition Width="520" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition Height="auto" />
|
||||
<RowDefinition />
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Label Grid.Column="0" Grid.Row="0" Content="Bezeichnung" />
|
||||
<Label Grid.Column="0" Grid.Row="1" Content="Rechtswert" />
|
||||
<Label Grid.Column="0" Grid.Row="2" Content="Hochwert" />
|
||||
<Label Grid.Column="0" Grid.Row="3" Content="Sohlhöhe" />
|
||||
<Label Grid.Column="0" Grid.Row="4" Content="Deckelhöhe" />
|
||||
<Label Grid.Column="0" Grid.Row="5" Content="Entwässerungsart" />
|
||||
|
||||
<TextBox Margin="2" Grid.Column="1" Grid.Row="0" Text="{Binding Objektbezeichnung}" />
|
||||
<TextBox Margin="2" Grid.Column="1" Grid.Row="1" Text="{Binding RechtsWert}" />
|
||||
<TextBox Margin="2" Grid.Column="1" Grid.Row="2" Text="{Binding HochWert}" />
|
||||
<TextBox Margin="2" Grid.Column="1" Grid.Row="3" Text="{Binding SohlHoehe}" />
|
||||
<TextBox Margin="2" Grid.Column="1" Grid.Row="4" Text="{Binding DeckelHoehe}" />
|
||||
<DockPanel Grid.Column="1" Grid.Row="5">
|
||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Regenwasser" />
|
||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Schmutzwasser" />
|
||||
<RadioButton Style="{StaticResource ToggleButtonList}" Content="Mischwasser" />
|
||||
</DockPanel>
|
||||
|
||||
|
||||
<StackPanel Grid.ColumnSpan="2" Grid.Row="6">
|
||||
<Button Content="Speichern" Command="{Binding Speichern}" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
SewerStammGen.WPF/Views/Schacht/SchachtEditView.xaml.cs
Normal file
28
SewerStammGen.WPF/Views/Schacht/SchachtEditView.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 SewerStammGen.WPF.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für UCEditSchacht.xaml
|
||||
/// </summary>
|
||||
public partial class SchachtEditView : UserControl
|
||||
{
|
||||
public SchachtEditView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
27
SewerStammGen.WPF/Views/Schacht/SchachtListView.xaml
Normal file
27
SewerStammGen.WPF/Views/Schacht/SchachtListView.xaml
Normal file
@@ -0,0 +1,27 @@
|
||||
<UserControl x:Class="SewerStammGen.WPF.Views.SchachtListView"
|
||||
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:SewerStammGen.WPF.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<StackPanel>
|
||||
<DataGrid ItemsSource="{Binding Schaechte}" AutoGenerateColumns="False" IsReadOnly="True" SelectionMode="Single" SelectedItem="{Binding SelectedSchacht}">
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Schachtnummer" Binding="{Binding Objektbezeichnung}" />
|
||||
<DataGridTextColumn Header="Rechtswert" Binding="{Binding RechtsWert}" />
|
||||
<DataGridTextColumn Header="Hochwert" Binding="{Binding HochWert}" />
|
||||
<DataGridTextColumn Header="Sohlhöhe" Binding="{Binding SohlHoehe}" />
|
||||
<DataGridTextColumn Header="Deckelhöhe" Binding="{Binding DeckelHoehe}" />
|
||||
<DataGridTextColumn Header="Entwässerung" Binding="{Binding Entwaesserung}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<Button Content="Schacht hinzufügen" Command="{Binding AddSchachtCommand}" />
|
||||
<Button Content="Schacht Editieren" Command="{Binding EditSchachtCommand}" />
|
||||
<Button Content="Schacht Löschen" Command="{Binding DeleteSchachtCommand}" />
|
||||
</StackPanel>
|
||||
|
||||
</Grid>
|
||||
</UserControl>
|
||||
28
SewerStammGen.WPF/Views/Schacht/SchachtListView.xaml.cs
Normal file
28
SewerStammGen.WPF/Views/Schacht/SchachtListView.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 SewerStammGen.WPF.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für SchachtList.xaml
|
||||
/// </summary>
|
||||
public partial class SchachtListView : UserControl
|
||||
{
|
||||
public SchachtListView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
36
SewerStammGen.WPF/Views/UCNormXML.xaml
Normal file
36
SewerStammGen.WPF/Views/UCNormXML.xaml
Normal file
@@ -0,0 +1,36 @@
|
||||
<UserControl x:Class="SewerStammGen.WPF.Views.UCNormXML"
|
||||
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:SewerStammGen.WPF.Views"
|
||||
mc:Ignorable="d"
|
||||
d:DesignHeight="450" d:DesignWidth="800">
|
||||
<Grid>
|
||||
<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>
|
||||
</UserControl>
|
||||
28
SewerStammGen.WPF/Views/UCNormXML.xaml.cs
Normal file
28
SewerStammGen.WPF/Views/UCNormXML.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 SewerStammGen.WPF.Views
|
||||
{
|
||||
/// <summary>
|
||||
/// Interaktionslogik für UCNormXML.xaml
|
||||
/// </summary>
|
||||
public partial class UCNormXML : UserControl
|
||||
{
|
||||
public UCNormXML()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
30
SewerStammGen.WPF/Views/styles/my_controls.xaml
Normal file
30
SewerStammGen.WPF/Views/styles/my_controls.xaml
Normal file
@@ -0,0 +1,30 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<Style x:Key="ToggleButtonList" TargetType="{x:Type ToggleButton}">
|
||||
<Setter Property="FrameworkElement.OverridesDefaultStyle" Value="True"/>
|
||||
<Setter Property="FrameworkElement.FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="Width" Value="170" />
|
||||
<Setter Property="Height" Value="70" />
|
||||
<Setter Property="Margin" Value="2" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ToggleButton}">
|
||||
<Grid>
|
||||
<Rectangle Name="rect" Fill="#FF808080" Stretch="Fill"/>
|
||||
<ContentPresenter VerticalAlignment="Top" HorizontalAlignment="Left" Margin="5" RecognizesAccessKey="True" TextBlock.FontFamily="Seggeo" TextBlock.FontSize="16" TextBlock.Foreground="#FFFFFFFF" TextBlock.FontWeight="Light" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="UIElement.IsMouseOver" Value="True">
|
||||
<Setter TargetName="rect" Property="Shape.Fill" Value="BlueViolet"/>
|
||||
<Setter Property="Foreground" Value="#FFFFFFFF"/>
|
||||
</Trigger>
|
||||
<Trigger Property="ToggleButton.IsChecked" Value="True">
|
||||
<Setter TargetName="rect" Property="Shape.Fill" Value="BlueViolet" />
|
||||
<Setter Property="Foreground" Value="#FFFFFFFF" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
7
SewerStammGen.WPF/appsettings.json
Normal file
7
SewerStammGen.WPF/appsettings.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ConnectionStrings": {
|
||||
"databaseToUse": "default",
|
||||
"default": "Host = localhost; Database = SewerGen; Username = SewerGen; Password = SewerGen",
|
||||
"sqlite": "Data Source=database.db"
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user