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 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/BeWo/View/Controls/TextViewer.xaml.cs b/BeWo/View/Controls/TextViewer.xaml.cs
new file mode 100644
index 000000000..a4883d1b6
--- /dev/null
+++ b/BeWo/View/Controls/TextViewer.xaml.cs
@@ -0,0 +1,35 @@
+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 BeWo.View.Controls
+{
+ ///
+ /// Interaktionslogik für TextViewer.xaml
+ ///
+ public partial class TextViewer : UserControl
+ {
+ public TextViewer()
+ {
+ InitializeComponent();
+ }
+
+ public string Text { get => txt.Text; set => txt.Text = value; }
+
+ private void Button_Click(object sender, RoutedEventArgs e)
+ {
+ Clipboard.SetText(Text);
+ }
+ }
+}