using BeWo.View.Windows; using BeWo.ViewModel.View.AI; using BeWo.ViewModel; using BeWo.ViewModel.Light; using BS.Shared; using DevExpress.Mvvm.Native; 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.Controls.Primitives; namespace BeWo.Services { public class BeWoWindowFactory : IWindowFactory { public Dictionary UIContext2Header { get; set; } = new Dictionary() { {AiContextType.ServiceRecord, "KI Chat: Zeiterfassung" }, {AiContextType.CustomerNavigation, "KI Chat: Klienten Übersicht" }, {AiContextType.PersonNavigation, "KI Chat: Personen Übersicht" }, {AiContextType.EmployeeNavigation, "KI Chat: Mitarbeiter Übersicht" }, {AiContextType.OrganisationNavigation, "KI Chat: Organisation Übersicht" }, {AiContextType.SupportConceptNavigation, "KI Chat: Hilfeplan Übersicht" }, {AiContextType.CustomerDetail, "KI Chat: Klient" }, }; public AnimatedBeWoWindow GetAiConversationWindow(AiConversationChatViewModel viewModel, Control control, double height = 600, double width = 1200) { UIContext2Header.TryGetValue(viewModel.UIContext, out string title); if (string.IsNullOrEmpty(title)) title = "default"; var window = GetAnimatedBeWoWindow(title, control); return window; } public Control GetAiModalViewWindow(AiConversationChatViewModel viewModel, Control control, double height = 600, double width = 1200) { UIContext2Header.TryGetValue(viewModel.UIContext, out string title); if (string.IsNullOrEmpty(title)) title = "default"; var popup = GetAiModalViewWindow(title, control); return popup; } private Control GetAiModalViewWindow(string title, Control control, double height = 600, double width = 1200) { var popup = new GroupBox(); popup.Style = Application.Current.FindResource("PopUpWindowStyle") as Style; popup.Header = title; popup.Content = control; popup.Height = height; popup.Width = width; return popup; } public AnimatedBeWoWindow GetAnimatedBeWoWindow(string title, Control control, double? height = 600, double? width = 1200) { var beWoWindow = new AnimatedBeWoWindow(); if (height is double h) beWoWindow.Height = h; else beWoWindow.Height = double.NaN; if (width is double w) beWoWindow.Width = w; else beWoWindow.Width = double.NaN; beWoWindow.WindowStartupLocation = WindowStartupLocation.CenterOwner; beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow; beWoWindow.Title = title + " Fenster"; beWoWindow.rootGroupBox.Header = title; beWoWindow.GroupBoxContent = control; return beWoWindow; } public string GetGkvTitle(GkvAbrechnungLightVM vm) { return "GKV-Abrechnung Nr. " + vm.Oid; } } }