Implement ScrollContainerProperty to allow plugins to disable the default scrollviewer wrapper on their controls
This commit is contained in:
24
Torch.Server/Views/Extensions.cs
Normal file
24
Torch.Server/Views/Extensions.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user