Implement ScrollContainerProperty to allow plugins to disable the default scrollviewer wrapper on their controls

This commit is contained in:
Brant Martin
2019-05-08 18:34:09 -04:00
parent de12327ac2
commit 91ceb0aa22
3 changed files with 28 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace Torch.Server.Views
{
public static class Extensions
{
public static readonly DependencyProperty ScrollContainerProperty = DependencyProperty.RegisterAttached("ScrollContainer", typeof(bool), typeof(Extensions), new PropertyMetadata(true));
public static bool GetScrollContainer(this UIElement ui)
{
return (bool)ui.GetValue(ScrollContainerProperty);
}
public static void SetScrollContainer(this UIElement ui, bool value)
{
ui.SetValue(ScrollContainerProperty, value);
}
}
}