diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 80716520d9..6b910fc615 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,8 +1,8 @@ --- name: Bug report -about: Create a report to help us improve +about: Create a report to help us improve Avalonia title: '' -labels: '' +labels: bug assignees: '' --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d61..11fc491ef1 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project title: '' -labels: '' +labels: enhancement assignees: '' --- diff --git a/src/Avalonia.Base/Data/IndexerBinding.cs b/src/Avalonia.Base/Data/IndexerBinding.cs index cc3baa4530..4d07b53dd2 100644 --- a/src/Avalonia.Base/Data/IndexerBinding.cs +++ b/src/Avalonia.Base/Data/IndexerBinding.cs @@ -1,6 +1,4 @@ -using System; - -namespace Avalonia.Data +namespace Avalonia.Data { public class IndexerBinding : IBinding { @@ -24,23 +22,7 @@ namespace Avalonia.Data object anchor = null, bool enableDataValidation = false) { - var mode = Mode == BindingMode.Default ? - targetProperty.GetMetadata(target.GetType()).DefaultBindingMode : - Mode; - - switch (mode) - { - case BindingMode.OneTime: - return InstancedBinding.OneTime(Source.GetObservable(Property)); - case BindingMode.OneWay: - return InstancedBinding.OneWay(Source.GetObservable(Property)); - case BindingMode.OneWayToSource: - return InstancedBinding.OneWayToSource(Source.GetSubject(Property)); - case BindingMode.TwoWay: - return InstancedBinding.TwoWay(Source.GetSubject(Property)); - default: - throw new NotSupportedException("Unsupported BindingMode."); - } + return new InstancedBinding(Source.GetSubject(Property), Mode, BindingPriority.LocalValue); } } } diff --git a/src/Avalonia.Controls/Primitives/VisualLayerManager.cs b/src/Avalonia.Controls/Primitives/VisualLayerManager.cs index e5e27c169a..03a84e26f2 100644 --- a/src/Avalonia.Controls/Primitives/VisualLayerManager.cs +++ b/src/Avalonia.Controls/Primitives/VisualLayerManager.cs @@ -67,8 +67,6 @@ namespace Avalonia.Controls.Primitives { get { - if (IsPopup) - return null; var rv = FindLayer(); if (rv == null) { diff --git a/src/Avalonia.Controls/Slider.cs b/src/Avalonia.Controls/Slider.cs index fe4b24099f..74de33529a 100644 --- a/src/Avalonia.Controls/Slider.cs +++ b/src/Avalonia.Controls/Slider.cs @@ -11,7 +11,6 @@ using Avalonia.Utilities; namespace Avalonia.Controls { - /// /// Enum which describes how to position the ticks in a . /// @@ -84,6 +83,9 @@ namespace Avalonia.Controls private IDisposable _increaseButtonSubscription; private IDisposable _increaseButtonReleaseDispose; private IDisposable _pointerMovedDispose; + private IDisposable _trackOnKeyDownDispose; + + private const double Tolerance = 0.0001; /// /// Initializes static members of the class. @@ -95,7 +97,7 @@ namespace Avalonia.Controls Thumb.DragStartedEvent.AddClassHandler((x, e) => x.OnThumbDragStarted(e), RoutingStrategies.Bubble); Thumb.DragCompletedEvent.AddClassHandler((x, e) => x.OnThumbDragCompleted(e), RoutingStrategies.Bubble); - + ValueProperty.OverrideMetadata(new DirectPropertyMetadata(enableDataValidation: true)); } @@ -157,13 +159,14 @@ namespace Avalonia.Controls protected override void OnApplyTemplate(TemplateAppliedEventArgs e) { base.OnApplyTemplate(e); - + _decreaseButtonPressDispose?.Dispose(); _decreaseButtonReleaseDispose?.Dispose(); _increaseButtonSubscription?.Dispose(); _increaseButtonReleaseDispose?.Dispose(); _pointerMovedDispose?.Dispose(); - + _trackOnKeyDownDispose?.Dispose(); + _decreaseButton = e.NameScope.Find