Browse Source

Merge branch 'master' into windows-position

pull/7450/head
Nathan Garside 5 years ago
committed by GitHub
parent
commit
9c4722e409
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 9
      src/Avalonia.Controls.DataGrid/DataGrid.cs
  2. 197
      src/Avalonia.Controls/Button.cs
  3. 34
      src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs
  4. 52
      src/Avalonia.Controls/ScrollViewer.cs
  5. 2
      src/Avalonia.OpenGL/Egl/EglContext.cs
  6. 2
      src/Avalonia.Themes.Default/Controls/ListBox.xaml
  7. 3
      src/Avalonia.Themes.Default/Controls/ScrollViewer.xaml
  8. 2
      src/Avalonia.Themes.Default/Controls/TextBox.xaml
  9. 2
      src/Avalonia.Themes.Default/Controls/TreeView.xaml
  10. 2
      src/Avalonia.Themes.Fluent/Controls/ListBox.xaml
  11. 3
      src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml
  12. 2
      src/Avalonia.Themes.Fluent/Controls/TextBox.xaml
  13. 2
      src/Avalonia.Themes.Fluent/Controls/TreeView.xaml

9
src/Avalonia.Controls.DataGrid/DataGrid.cs

@ -2215,7 +2215,14 @@ namespace Avalonia.Controls
/// <param name="e">PointerWheelEventArgs</param>
protected override void OnPointerWheelChanged(PointerWheelEventArgs e)
{
e.Handled = e.Handled || UpdateScroll(e.Delta * DATAGRID_mouseWheelDelta);
if(UpdateScroll(e.Delta * DATAGRID_mouseWheelDelta))
{
e.Handled = true;
}
else
{
e.Handled = e.Handled || !ScrollViewer.GetIsScrollChainingEnabled(this);
}
}
internal bool UpdateScroll(Vector delta)

197
src/Avalonia.Controls/Button.cs

@ -59,13 +59,13 @@ namespace Avalonia.Controls
AvaloniaProperty.Register<Button, object>(nameof(CommandParameter));
/// <summary>
/// Defines the <see cref="IsDefaultProperty"/> property.
/// Defines the <see cref="IsDefault"/> property.
/// </summary>
public static readonly StyledProperty<bool> IsDefaultProperty =
AvaloniaProperty.Register<Button, bool>(nameof(IsDefault));
/// <summary>
/// Defines the <see cref="IsCancelProperty"/> property.
/// Defines the <see cref="IsCancel"/> property.
/// </summary>
public static readonly StyledProperty<bool> IsCancelProperty =
AvaloniaProperty.Register<Button, bool>(nameof(IsCancel));
@ -76,6 +76,9 @@ namespace Avalonia.Controls
public static readonly RoutedEvent<RoutedEventArgs> ClickEvent =
RoutedEvent.Register<Button, RoutedEventArgs>(nameof(Click), RoutingStrategies.Bubble);
/// <summary>
/// Defines the <see cref="IsPressed"/> property.
/// </summary>
public static readonly StyledProperty<bool> IsPressedProperty =
AvaloniaProperty.Register<Button, bool>(nameof(IsPressed));
@ -95,13 +98,12 @@ namespace Avalonia.Controls
static Button()
{
FocusableProperty.OverrideDefaultValue(typeof(Button), true);
CommandProperty.Changed.Subscribe(CommandChanged);
CommandParameterProperty.Changed.Subscribe(CommandParameterChanged);
IsDefaultProperty.Changed.Subscribe(IsDefaultChanged);
IsCancelProperty.Changed.Subscribe(IsCancelChanged);
AccessKeyHandler.AccessKeyPressedEvent.AddClassHandler<Button>((lbl, args) => lbl.OnAccessKey(args));
}
/// <summary>
/// Initializes a new instance of the <see cref="Button"/> class.
/// </summary>
public Button()
{
UpdatePseudoClasses(IsPressed);
@ -112,8 +114,8 @@ namespace Avalonia.Controls
/// </summary>
public event EventHandler<RoutedEventArgs> Click
{
add { AddHandler(ClickEvent, value); }
remove { RemoveHandler(ClickEvent, value); }
add => AddHandler(ClickEvent, value);
remove => RemoveHandler(ClickEvent, value);
}
/// <summary>
@ -121,8 +123,8 @@ namespace Avalonia.Controls
/// </summary>
public ClickMode ClickMode
{
get { return GetValue(ClickModeProperty); }
set { SetValue(ClickModeProperty, value); }
get => GetValue(ClickModeProperty);
set => SetValue(ClickModeProperty, value);
}
/// <summary>
@ -130,8 +132,8 @@ namespace Avalonia.Controls
/// </summary>
public ICommand Command
{
get { return _command; }
set { SetAndRaise(CommandProperty, ref _command, value); }
get => _command;
set => SetAndRaise(CommandProperty, ref _command, value);
}
/// <summary>
@ -139,8 +141,8 @@ namespace Avalonia.Controls
/// </summary>
public KeyGesture HotKey
{
get { return GetValue(HotKeyProperty); }
set { SetValue(HotKeyProperty, value); }
get => GetValue(HotKeyProperty);
set => SetValue(HotKeyProperty, value);
}
/// <summary>
@ -148,8 +150,8 @@ namespace Avalonia.Controls
/// </summary>
public object CommandParameter
{
get { return GetValue(CommandParameterProperty); }
set { SetValue(CommandParameterProperty, value); }
get => GetValue(CommandParameterProperty);
set => SetValue(CommandParameterProperty, value);
}
/// <summary>
@ -158,8 +160,8 @@ namespace Avalonia.Controls
/// </summary>
public bool IsDefault
{
get { return GetValue(IsDefaultProperty); }
set { SetValue(IsDefaultProperty, value); }
get => GetValue(IsDefaultProperty);
set => SetValue(IsDefaultProperty, value);
}
/// <summary>
@ -168,18 +170,21 @@ namespace Avalonia.Controls
/// </summary>
public bool IsCancel
{
get { return GetValue(IsCancelProperty); }
set { SetValue(IsCancelProperty, value); }
get => GetValue(IsCancelProperty);
set => SetValue(IsCancelProperty, value);
}
/// <summary>
/// Gets or sets a value indicating whether the button is currently pressed.
/// </summary>
public bool IsPressed
{
get { return GetValue(IsPressedProperty); }
private set { SetValue(IsPressedProperty, value); }
get => GetValue(IsPressedProperty);
private set => SetValue(IsPressedProperty, value);
}
/// <summary>
/// Gets or sets the Flyout that should be shown with this button
/// Gets or sets the Flyout that should be shown with this button.
/// </summary>
public FlyoutBase Flyout
{
@ -187,7 +192,8 @@ namespace Avalonia.Controls
set => SetValue(FlyoutProperty, value);
}
protected override bool IsEnabledCore => base.IsEnabledCore && _commandCanExecute;
/// <inheritdoc/>
protected override bool IsEnabledCore => base.IsEnabledCore && _commandCanExecute;
/// <inheritdoc/>
protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)
@ -224,6 +230,7 @@ namespace Avalonia.Controls
}
}
/// <inheritdoc/>
protected override void OnAttachedToLogicalTree(LogicalTreeAttachmentEventArgs e)
{
if (_hotkey != null) // Control attached again, set Hotkey to create a hotkey manager for this control
@ -240,6 +247,7 @@ namespace Avalonia.Controls
}
}
/// <inheritdoc/>
protected override void OnDetachedFromLogicalTree(LogicalTreeAttachmentEventArgs e)
{
// This will cause the hotkey manager to dispose the observer and the reference to this control
@ -358,12 +366,14 @@ namespace Avalonia.Controls
}
}
}
/// <inheritdoc/>
protected override void OnPointerCaptureLost(PointerCaptureLostEventArgs e)
{
IsPressed = false;
}
/// <inheritdoc/>
protected override void OnLostFocus(RoutedEventArgs e)
{
base.OnLostFocus(e);
@ -371,119 +381,93 @@ namespace Avalonia.Controls
IsPressed = false;
}
/// <inheritdoc/>
protected override void OnPropertyChanged<T>(AvaloniaPropertyChangedEventArgs<T> change)
{
base.OnPropertyChanged(change);
if (change.Property == IsPressedProperty)
{
UpdatePseudoClasses(change.NewValue.GetValueOrDefault<bool>());
}
else if (change.Property == FlyoutProperty)
if (change.Property == CommandProperty)
{
// If flyout is changed while one is already open, make sure we
// close the old one first
if (change.OldValue.GetValueOrDefault() is FlyoutBase oldFlyout &&
oldFlyout.IsOpen)
if (((ILogical)this).IsAttachedToLogicalTree)
{
oldFlyout.Hide();
if (change.OldValue.GetValueOrDefault() is ICommand oldCommand)
{
oldCommand.CanExecuteChanged -= CanExecuteChanged;
}
if (change.NewValue.GetValueOrDefault() is ICommand newCommand)
{
newCommand.CanExecuteChanged += CanExecuteChanged;
}
}
}
}
protected override void UpdateDataValidation<T>(AvaloniaProperty<T> property, BindingValue<T> value)
{
base.UpdateDataValidation(property, value);
if (property == CommandProperty)
CanExecuteChanged(this, EventArgs.Empty);
}
else if (change.Property == CommandParameterProperty)
{
if (value.Type == BindingValueType.BindingError)
CanExecuteChanged(this, EventArgs.Empty);
}
else if (change.Property == IsCancelProperty)
{
var isCancel = change.NewValue.GetValueOrDefault<bool>();
if (VisualRoot is IInputElement inputRoot)
{
if (_commandCanExecute)
if (isCancel)
{
_commandCanExecute = false;
UpdateIsEffectivelyEnabled();
ListenForCancel(inputRoot);
}
else
{
StopListeningForCancel(inputRoot);
}
}
}
}
/// <summary>
/// Called when the <see cref="Command"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private static void CommandChanged(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is Button button)
else if (change.Property == IsDefaultProperty)
{
if (((ILogical)button).IsAttachedToLogicalTree)
var isDefault = change.NewValue.GetValueOrDefault<bool>();
if (VisualRoot is IInputElement inputRoot)
{
if (e.OldValue is ICommand oldCommand)
if (isDefault)
{
oldCommand.CanExecuteChanged -= button.CanExecuteChanged;
ListenForDefault(inputRoot);
}
if (e.NewValue is ICommand newCommand)
else
{
newCommand.CanExecuteChanged += button.CanExecuteChanged;
StopListeningForDefault(inputRoot);
}
}
button.CanExecuteChanged(button, EventArgs.Empty);
}
}
/// <summary>
/// Called when the <see cref="CommandParameter"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private static void CommandParameterChanged(AvaloniaPropertyChangedEventArgs e)
{
if (e.Sender is Button button)
else if (change.Property == IsPressedProperty)
{
button.CanExecuteChanged(button, EventArgs.Empty);
UpdatePseudoClasses(change.NewValue.GetValueOrDefault<bool>());
}
}
/// <summary>
/// Called when the <see cref="IsDefault"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private static void IsDefaultChanged(AvaloniaPropertyChangedEventArgs e)
{
var button = e.Sender as Button;
var isDefault = (bool)e.NewValue;
if (button?.VisualRoot is IInputElement inputRoot)
else if (change.Property == FlyoutProperty)
{
if (isDefault)
{
button.ListenForDefault(inputRoot);
}
else
// If flyout is changed while one is already open, make sure we
// close the old one first
if (change.OldValue.GetValueOrDefault() is FlyoutBase oldFlyout &&
oldFlyout.IsOpen)
{
button.StopListeningForDefault(inputRoot);
oldFlyout.Hide();
}
}
}
/// <summary>
/// Called when the <see cref="IsCancel"/> property changes.
/// </summary>
/// <param name="e">The event args.</param>
private static void IsCancelChanged(AvaloniaPropertyChangedEventArgs e)
/// <inheritdoc/>
protected override void UpdateDataValidation<T>(AvaloniaProperty<T> property, BindingValue<T> value)
{
var button = e.Sender as Button;
var isCancel = (bool)e.NewValue;
if (button?.VisualRoot is IInputElement inputRoot)
base.UpdateDataValidation(property, value);
if (property == CommandProperty)
{
if (isCancel)
{
button.ListenForCancel(inputRoot);
}
else
if (value.Type == BindingValueType.BindingError)
{
button.StopListeningForCancel(inputRoot);
if (_commandCanExecute)
{
_commandCanExecute = false;
UpdateIsEffectivelyEnabled();
}
}
}
}
@ -566,6 +550,9 @@ namespace Avalonia.Controls
}
}
/// <summary>
/// Updates the visual state of the control by applying latest PseudoClasses.
/// </summary>
private void UpdatePseudoClasses(bool isPressed)
{
PseudoClasses.Set(":pressed", isPressed);

34
src/Avalonia.Controls/Presenters/ScrollContentPresenter.cs

@ -60,6 +60,12 @@ namespace Avalonia.Controls.Presenters
o => o.Viewport,
(o, v) => o.Viewport = v);
/// <summary>
/// Defines the <see cref="IsScrollChainingEnabled"/> property.
/// </summary>
public static readonly StyledProperty<bool> IsScrollChainingEnabledProperty =
ScrollViewer.IsScrollChainingEnabledProperty.AddOwner<ScrollContentPresenter>();
private bool _canHorizontallyScroll;
private bool _canVerticallyScroll;
private bool _arranging;
@ -138,6 +144,20 @@ namespace Avalonia.Controls.Presenters
private set { SetAndRaise(ViewportProperty, ref _viewport, value); }
}
/// <summary>
/// Gets or sets if scroll chaining is enabled. The default value is true.
/// </summary>
/// <remarks>
/// After a user hits a scroll limit on an element that has been nested within another scrollable element,
/// you can specify whether that parent element should continue the scrolling operation begun in its child element.
/// This is called scroll chaining.
/// </remarks>
public bool IsScrollChainingEnabled
{
get => GetValue(IsScrollChainingEnabledProperty);
set => SetValue(IsScrollChainingEnabledProperty, value);
}
/// <inheritdoc/>
IControl? IScrollAnchorProvider.CurrentAnchor
{
@ -405,8 +425,11 @@ namespace Avalonia.Controls.Presenters
_activeLogicalGestureScrolls[e.Id] = delta;
}
Offset = new Vector(x, y);
e.Handled = true;
Vector newOffset = new Vector(x, y);
bool offsetChanged = newOffset != Offset;
Offset = newOffset;
e.Handled = !IsScrollChainingEnabled || offsetChanged;
}
}
@ -440,8 +463,11 @@ namespace Avalonia.Controls.Presenters
x = Math.Min(x, Extent.Width - Viewport.Width);
}
Offset = new Vector(x, y);
e.Handled = true;
Vector newOffset = new Vector(x, y);
bool offsetChanged = newOffset != Offset;
Offset = newOffset;
e.Handled = !IsScrollChainingEnabled || offsetChanged;
}
}

52
src/Avalonia.Controls/ScrollViewer.cs

@ -181,6 +181,14 @@ namespace Avalonia.Controls
nameof(AllowAutoHide),
true);
/// <summary>
/// Defines the <see cref="IsScrollChainingEnabled"/> property.
/// </summary>
public static readonly AttachedProperty<bool> IsScrollChainingEnabledProperty =
AvaloniaProperty.RegisterAttached<ScrollViewer, Control, bool>(
nameof(IsScrollChainingEnabled),
defaultValue: true);
/// <summary>
/// Defines the <see cref="ScrollChanged"/> event.
/// </summary>
@ -418,6 +426,20 @@ namespace Avalonia.Controls
set => SetValue(AllowAutoHideProperty, value);
}
/// <summary>
/// Gets or sets if scroll chaining is enabled. The default value is true.
/// </summary>
/// <remarks>
/// After a user hits a scroll limit on an element that has been nested within another scrollable element,
/// you can specify whether that parent element should continue the scrolling operation begun in its child element.
/// This is called scroll chaining.
/// </remarks>
public bool IsScrollChainingEnabled
{
get => GetValue(IsScrollChainingEnabledProperty);
set => SetValue(IsScrollChainingEnabledProperty, value);
}
/// <summary>
/// Scrolls the content up one line.
/// </summary>
@ -548,6 +570,36 @@ namespace Avalonia.Controls
return control.GetValue(AllowAutoHideProperty);
}
/// <summary>
/// Sets the value of the IsScrollChainingEnabled attached property.
/// </summary>
/// <param name="control">The control to set the value on.</param>
/// <param name="value">The value of the property.</param>
/// <remarks>
/// After a user hits a scroll limit on an element that has been nested within another scrollable element,
/// you can specify whether that parent element should continue the scrolling operation begun in its child element.
/// This is called scroll chaining.
/// </remarks>
public static void SetIsScrollChainingEnabled(Control control, bool value)
{
control.SetValue(IsScrollChainingEnabledProperty, value);
}
/// <summary>
/// Gets the value of the IsScrollChainingEnabled attached property.
/// </summary>
/// <param name="control">The control to read the value from.</param>
/// <returns>The value of the property.</returns>
/// <remarks>
/// After a user hits a scroll limit on an element that has been nested within another scrollable element,
/// you can specify whether that parent element should continue the scrolling operation begun in its child element.
/// This is called scroll chaining.
/// </remarks>
public static bool GetIsScrollChainingEnabled(Control control)
{
return control.GetValue(IsScrollChainingEnabledProperty);
}
/// <summary>
/// Gets the value of the VerticalScrollBarVisibility attached property.
/// </summary>

2
src/Avalonia.OpenGL/Egl/EglContext.cs

@ -82,7 +82,7 @@ namespace Avalonia.OpenGL.Egl
finally
{
if(!success)
Monitor.Enter(_lock);
Monitor.Exit(_lock);
}
}

2
src/Avalonia.Themes.Default/Controls/ListBox.xaml

@ -6,6 +6,7 @@
<Setter Property="Padding" Value="4"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
<Setter Property="Template">
<ControlTemplate>
<Border Name="border" BorderBrush="{TemplateBinding BorderBrush}"
@ -15,6 +16,7 @@
Background="{TemplateBinding Background}"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}">
<ItemsPresenter Name="PART_ItemsPresenter"
Items="{TemplateBinding Items}"

3
src/Avalonia.Themes.Default/Controls/ScrollViewer.xaml

@ -15,7 +15,8 @@
Extent="{TemplateBinding Extent, Mode=TwoWay}"
Margin="{TemplateBinding Padding}"
Offset="{TemplateBinding Offset, Mode=TwoWay}"
Viewport="{TemplateBinding Viewport, Mode=TwoWay}">
Viewport="{TemplateBinding Viewport, Mode=TwoWay}"
IsScrollChainingEnabled="{TemplateBinding IsScrollChainingEnabled}">
<ScrollContentPresenter.GestureRecognizers>
<ScrollGestureRecognizer
CanHorizontallyScroll="{TemplateBinding CanHorizontallyScroll}"

2
src/Avalonia.Themes.Default/Controls/TextBox.xaml

@ -25,6 +25,7 @@
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource HighlightForegroundBrush}"/>
<Setter Property="Padding" Value="4"/>
<Setter Property="ContextFlyout" Value="{StaticResource DefaultTextBoxContextFlyout}" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
<Setter Property="Template">
<ControlTemplate>
<Border Name="border"
@ -59,6 +60,7 @@
<ScrollViewer Grid.Column="1" Grid.ColumnSpan="1"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}">
<Panel>
<TextBlock Name="watermark"

2
src/Avalonia.Themes.Default/Controls/TreeView.xaml

@ -5,6 +5,7 @@
<Setter Property="Padding" Value="4"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
<Setter Property="Template">
<ControlTemplate>
<Border BorderBrush="{TemplateBinding BorderBrush}"
@ -13,6 +14,7 @@
<ScrollViewer Background="{TemplateBinding Background}"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}">
<ItemsPresenter Name="PART_ItemsPresenter"
Items="{TemplateBinding Items}"

2
src/Avalonia.Themes.Fluent/Controls/ListBox.xaml

@ -16,6 +16,7 @@
<Setter Property="BorderThickness" Value="{DynamicResource ListBoxBorderThemeThickness}" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
<Setter Property="Template">
<ControlTemplate>
@ -28,6 +29,7 @@
<ScrollViewer Name="PART_ScrollViewer"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}">
<ItemsPresenter Name="PART_ItemsPresenter"
Items="{TemplateBinding Items}"

3
src/Avalonia.Themes.Fluent/Controls/ScrollViewer.xaml

@ -34,7 +34,8 @@
Extent="{TemplateBinding Extent, Mode=TwoWay}"
Margin="{TemplateBinding Padding}"
Offset="{TemplateBinding Offset, Mode=TwoWay}"
Viewport="{TemplateBinding Viewport, Mode=TwoWay}">
Viewport="{TemplateBinding Viewport, Mode=TwoWay}"
IsScrollChainingEnabled="{TemplateBinding IsScrollChainingEnabled}">
<ScrollContentPresenter.GestureRecognizers>
<ScrollGestureRecognizer
CanHorizontallyScroll="{TemplateBinding CanHorizontallyScroll}"

2
src/Avalonia.Themes.Fluent/Controls/TextBox.xaml

@ -41,6 +41,7 @@
<Setter Property="MinWidth" Value="{DynamicResource TextControlThemeMinWidth}" />
<Setter Property="Padding" Value="{DynamicResource TextControlThemePadding}" />
<Setter Property="FocusAdorner" Value="{x:Null}" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
<Setter Property="ContextFlyout" Value="{StaticResource DefaultTextBoxContextFlyout}" />
<Setter Property="Template">
<ControlTemplate>
@ -68,6 +69,7 @@
DockPanel.Dock="Top" />
<ScrollViewer HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}">
<Panel>
<TextBlock Name="PART_Watermark"

2
src/Avalonia.Themes.Fluent/Controls/TreeView.xaml

@ -6,6 +6,7 @@
<Setter Property="Padding" Value="0" />
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
<Setter Property="ScrollViewer.IsScrollChainingEnabled" Value="True" />
<Setter Property="Template">
<ControlTemplate>
<Border BorderBrush="{TemplateBinding BorderBrush}"
@ -14,6 +15,7 @@
<ScrollViewer Background="{TemplateBinding Background}"
HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"
IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}">
<ItemsPresenter Name="PART_ItemsPresenter"
Items="{TemplateBinding Items}"

Loading…
Cancel
Save