Files
BeWoPlaner/BeWo/View/BeWoWindowBuilder.cs
Rene Evertz 20f249e5b8 Mapping Bug fixes
Detail Fenster breiter
Detail Fenster Protokoll Header
Detail Fenster Daten von Gkv Abrechnung entfernt
Dateigröße wird mit Siffux angezeigt
2024-05-14 14:10:44 +02:00

73 lines
2.6 KiB
C#

using BeWo.View.Controls;
using BeWo.ViewModel;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
namespace BeWo.View
{
public static class BeWoWindowBuilder
{
public static BeWoWindow GetTextViewer(string title, string text, bool fixed_size = false, double height = 600, double width = 400)
{
if (fixed_size)
return GetTextViewer(title, text, height, height, height, width, width, width);
var min_height = Math.Min(height, 300);
var max_height = Math.Max(height, 1000);
var min_width = Math.Min(width, 200);
var max_width = Math.Max(width, 1900);
return GetTextViewer(title, text, min_height, height, max_height, min_width, width, max_width);
}
public static BeWoWindow GetTextViewer(string title, string text, double min_height, double height, double max_height, double min_width, double width, double max_width)
{
var control = new TextViewer();
control.Text = text;
var beWoWindow = GetGenericBeWoWindow(title, min_height, height, max_height, min_width, width, max_width);
beWoWindow.GroupBoxContent = control;
return beWoWindow;
}
public static BeWoWindow GetGkvAbrechnungDetailWindow(GkvAbrechnungVM vM, double height = 600, double width = 1200)
{
var detail = new GkvAbrechnungDetailControl(vM);
var beWoWindow = GetGenericBeWoWindow("Gkv Abrechnung Details", 100, height, 1000, 100, width, 1600);
beWoWindow.GroupBoxContent = detail;
return beWoWindow;
}
public static void ShowErrorMessageBox(string text)
{
MessageBox.Show(text, "Fehler", MessageBoxButton.OK, MessageBoxImage.Asterisk);
}
private static BeWoWindow GetGenericBeWoWindow(string title, double min_height, double height, double max_height, double min_width, double width, double max_width)
{
var beWoWindow = new BeWoWindow();
beWoWindow.Height = height;
beWoWindow.MinHeight = min_height;
beWoWindow.MaxHeight = max_height;
beWoWindow.Width = width;
beWoWindow.MinWidth = min_width;
beWoWindow.MaxHeight = max_width;
beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner;
beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow;
beWoWindow.rootGroupBox.Header = title;
return beWoWindow;
}
}
}