diff --git a/BeWo/BeWo.csproj b/BeWo/BeWo.csproj index 1c1a57d66..cc35da93e 100644 --- a/BeWo/BeWo.csproj +++ b/BeWo/BeWo.csproj @@ -320,6 +320,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + MSBuild:Compile Designer @@ -1083,6 +1087,9 @@ ListboxSelectControl.xaml + + TextViewer.xaml + ValueListEntryEditControl.xaml diff --git a/BeWo/View/BeWoWindowBuilder.cs b/BeWo/View/BeWoWindowBuilder.cs index 996c4457e..6fd966954 100644 --- a/BeWo/View/BeWoWindowBuilder.cs +++ b/BeWo/View/BeWoWindowBuilder.cs @@ -1,4 +1,5 @@ -using System; +using BeWo.View.Controls; +using System; using System.Collections.Generic; using System.Linq; using System.Text; @@ -20,28 +21,12 @@ namespace BeWo.View 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 TextBlock(); - + var control = new TextViewer(); control.Text = text; - var scrollviewer = new ScrollViewer(); - - scrollviewer.Content = control; - - 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.GroupBoxContent = scrollviewer; - beWoWindow.Owner = BeWoApp.CurrentBeWo.MainWindow; - beWoWindow.rootGroupBox.Header = title; - + var beWoWindow = GetGenericBeWoWindow(title, min_height, height, max_height, min_width, width, max_width); + beWoWindow.GroupBoxContent = control; + return beWoWindow; } @@ -49,5 +34,23 @@ namespace BeWo.View { 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; + } } } diff --git a/BeWo/View/Controls/TextViewer.xaml b/BeWo/View/Controls/TextViewer.xaml new file mode 100644 index 000000000..1e8e910a6 --- /dev/null +++ b/BeWo/View/Controls/TextViewer.xaml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + +