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

@@ -41,7 +41,9 @@ namespace Torch.Server.Views
{
if (propertyChangedEventArgs.PropertyName == nameof(PluginManagerViewModel.SelectedPlugin))
{
if (((PluginManagerViewModel)DataContext).SelectedPlugin.Control is PropertyGrid)
var plugin = ((PluginManagerViewModel)DataContext).SelectedPlugin;
if (plugin.Control is PropertyGrid || !plugin.Control.GetScrollContainer())
PScroll.VerticalScrollBarVisibility = ScrollBarVisibility.Disabled;
else
PScroll.VerticalScrollBarVisibility = ScrollBarVisibility.Auto;