aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/StubsUtils/Tango.StubsUtils.Service.UI/Controls/ScrollableFlowDocumentScrollViewer.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/StubsUtils/Tango.StubsUtils.Service.UI/Controls/ScrollableFlowDocumentScrollViewer.cs')
-rw-r--r--Software/Visual_Studio/StubsUtils/Tango.StubsUtils.Service.UI/Controls/ScrollableFlowDocumentScrollViewer.cs46
1 files changed, 46 insertions, 0 deletions
diff --git a/Software/Visual_Studio/StubsUtils/Tango.StubsUtils.Service.UI/Controls/ScrollableFlowDocumentScrollViewer.cs b/Software/Visual_Studio/StubsUtils/Tango.StubsUtils.Service.UI/Controls/ScrollableFlowDocumentScrollViewer.cs
new file mode 100644
index 000000000..5fa00a4ac
--- /dev/null
+++ b/Software/Visual_Studio/StubsUtils/Tango.StubsUtils.Service.UI/Controls/ScrollableFlowDocumentScrollViewer.cs
@@ -0,0 +1,46 @@
+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.Media;
+
+namespace Tango.StubsUtils.Service.UI.Controls
+{
+ public class ScrollableFlowDocumentScrollViewer : FlowDocumentScrollViewer
+ {
+ /// <summary>
+ /// Backing store for the <see cref="ScrollViewer"/> property.
+ /// </summary>
+ private ScrollViewer scrollViewer;
+
+ /// <summary>
+ /// Gets the scroll viewer contained within the FlowDocumentScrollViewer control
+ /// </summary>
+ public ScrollViewer ScrollViewer
+ {
+ get
+ {
+ if (this.scrollViewer == null)
+ {
+ DependencyObject obj = this;
+
+ do
+ {
+ if (VisualTreeHelper.GetChildrenCount(obj) > 0)
+ obj = VisualTreeHelper.GetChild(obj as Visual, 0);
+ else
+ return null;
+ }
+ while (!(obj is ScrollViewer));
+
+ this.scrollViewer = obj as ScrollViewer;
+ }
+
+ return this.scrollViewer;
+ }
+ }
+ }
+}